function addToFavorites() {
	if (document.all) {
		window.external.addFavorite("http://www.votorantim.com.br/","Votorantim");
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function htmlOkay() {
	showHideQuant = 0
	table = document.getElementsByTagName("table");
	for(i=0;i<table.length;i++) {
		if (table[i].className == "ms-listviewtable") showHideQuant += 1;
	}
	for(w=0;w<showHideQuant;w++) {
		this.num = w+1;
		for(s=1;s<200;s++) {
			obj = document.getElementById('titl'+this.num+'-'+s+'_');
			if (obj != null) {
				objTd = obj.getElementsByTagName("td")[0];
				objHtml = objTd .innerHTML;
				objHtml = objHtml.replace(/:&nbsp;/i, '');
				objHtml = objHtml.replace(/;return false/i, ";trocaSinal('btSinal"+this.num+"-"+s+"');return false");
				objHtml = objHtml.replace(/border=/i, 'style="display: none;" border=');
				if (objTd.getElementsByTagName("img")[1].src.split('/')[5] == "minus.gif") {
					objHtml = objHtml.replace(/<img id=/i, '<img id="btSinal'+this.num+'-'+s+'" src="/Style Library/SiteVotorantim/master/img/showHideMenos.gif" style="position:relative; top: 1px; left: -2px;" border="0"><img id=');
				} else {
					objHtml = objHtml.replace(/<img id=/i, '<img id="btSinal'+this.num+'-'+s+'" src="/Style Library/SiteVotorantim/master/img/showHideMais.gif" style="position:relative; top: 1px; left: -2px;" border="0"><img id=');
				}
				objTd.innerHTML = objHtml;
				objTd.getElementsByTagName("a")[1].style.display = "none";
				//objTd.getElementsByTagName("img")[1].height = "11";
			} else {
				break;
			}
		}
	}
}
function trocaSinal(ident) {
	objSinal = document.getElementById(ident);
	if (objSinal.src.split("/")[7] == "showHideMais.gif") {
		objSinal.src = "/Style Library/SiteVotorantim/master/img/showHideMenos.gif"
	} else {
		objSinal.src = "/Style Library/SiteVotorantim/master/img/showHideMais.gif"
	}
}
function bodyLoading(){
    idRodape = document.getElementById("rodape");
    if(idRodape != null) {
    	htmlOkay();
    } else {
    	setTimeout(bodyLoading, 100);
    }
}

bodyLoading();

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

var textoBusca = ""
function limpa_campo(obj) {
	textoBusca = obj.value;
	obj.value = "";
}
function busca_campo(obj) {
	if (obj.value=="") obj.value = textoBusca;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function hideSelects() {
	if (navigator.appName == "Microsoft Internet Explorer") {
		versao_arr = navigator.appVersion.split(";");
		versao = versao_arr[1]
		if (versao == " MSIE 6.0") {
			amb_select = document.getElementsByTagName("select");
			for(i=1;i<amb_select.length;i++) {
				amb_select[i].style.display = "none"
			}
		}
	} 	
}
function showSelects() {
	if (navigator.appName == "Microsoft Internet Explorer") {
		versao_arr = navigator.appVersion.split(";");
		versao = versao_arr[1]
		if (versao == " MSIE 6.0") {
			amb_select = document.getElementsByTagName("select");
			for(i=1;i<amb_select.length;i++) {
				amb_select[i].style.display = "block"
			}
		}
	} 	
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function abre_ambientacao() {
	amb_obj = document.getElementById("flash_amb_full");
	amb_obj.style.height = "500px";
	hideSelects();
	
}
function fecha_ambientacao() {
	amb_obj = document.getElementById("flash_amb_full");
	amb_obj.style.height = "110px";
	showSelects();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function menutopo_opensub(obj) {
	if (navigator.appName == "Microsoft Internet Explorer") { 
		tags1 = "</TD>"; tags2 = "<DIV";
	} else {
		tags1 = "</td>"; tags2 = "<div";
	}
	conj = document.getElementById("conj1");
	menu_quant = conj.innerHTML.split(tags1).length;
	for(i=1;i<menu_quant;i++) {
		submenu = document.getElementById("submenu"+i);
		if (submenu.innerHTML != "") {
			obj_inner_basic = submenu.getElementsByTagName('span')[0];
			objMenu = document.getElementById("submenu"+i+"_conj");
			obj_inner_basic.innerHTML = "";
			if (objMenu != null) objMenu.style.display = "none";
		}
	}
	submenuLast = document.getElementById("submenu"+(menu_quant-1)+"_conj");
	if (submenuLast != null) {
		submenuLast.style.marginLeft =  "-85px";
	}
	submenu = document.getElementById("sub"+obj.id);
	if (submenu.innerHTML != "") {
		obj_inner_basic = submenu.getElementsByTagName('span')[0];
		objMenu = document.getElementById("sub"+obj.id+"_conj");
		if (objMenu != null) {
			obj_inner_basic.style.width = submenu.offsetWidth;
			obj_inner_basic.innerHTML = "<div class='aba'></div><div class='aba_hide_seta'><img src='' width='1' height='1' /></div>";
			objMenu.style.display = "block";
		}
	}
	hideSelects();
}
function menutopo_fechasub() {
	submenu_nome = objname.split("_");
	submenu = document.getElementById(submenu_nome[0]);
	if (submenu.innerHTML != "") {
		obj_inner_basic = submenu.getElementsByTagName('span')[0];
		objMenu = document.getElementById(submenu.id+"_conj");
		obj_inner_basic.innerHTML = "";
		if (objMenu != null) objMenu.style.display = "none";
	}
	showSelects();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
var temposub = ""
function menutopo_timer_fechasub(obj) {
	objname = obj
	temposub = setTimeout(menutopo_fechasub,500);
}
function menutopo_cancela_fechasub(obj) {
	clearTimeout(temposub);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function menutopo_opensub2(oName) {
	document.getElementById(oName).style.display = "block";
	eval("temposub2"+oName+"=''");
}
function menutopo_fechasub2(oName) {
	document.getElementById(oName).style.display = "none";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function menutopo_timer_fechasub2(oName) {
	eval("temposub2"+oName+" = setTimeout(function() { menutopo_fechasub2(oName) },100)");
}
function menutopo_cancela_fechasub2(oName) {
	clearTimeout(eval("temposub2"+oName.id));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
tamanho_atual = 1
function mudaTamanho(valor) { // 12,14,16
	meio = document.getElementById("conteudo");
	h1 = document.getElementsByTagName('h1');
	h2 = document.getElementsByTagName('h2');
	h3 = document.getElementsByTagName('h3');
	p = meio.getElementsByTagName('p');
	li = meio.getElementsByTagName('li');
	lat = document.getElementById('menu_internas');
	if (lat != null) lat = lat.getElementsByTagName('a');
	bread = document.getElementById('breadcrumb');
	if (valor=='menos') {
		if (tamanho_atual > 1) tamanho_atual -= 1
	}
	if (valor=='mais') {
		if (tamanho_atual < 4) tamanho_atual += 1
	}
	for(i=0;i<h1.length;i++) { h1[i].style.fontSize = String((16+(tamanho_atual*2))+"px") }
	for(i=0;i<h2.length;i++) { h2[i].style.fontSize = String((14+(tamanho_atual*2))+"px") }
	for(i=0;i<h3.length;i++) { h3[i].style.fontSize = String((12+(tamanho_atual*2))+"px") }	
	for(i=0;i<p.length;i++) { p[i].style.fontSize = String((10+(tamanho_atual*2))+"px") }
	for(i=0;i<li.length;i++) { li[i].style.fontSize = String((10+(tamanho_atual*2))+"px") }
	if (lat != null) {
		for(i=0;i<lat.length;i++) { 
			lat[i].style.fontSize = String((10+(tamanho_atual*2))+"px");
			if (lat[i].className == "zz1_QuickLaunchMenu_1 ms-navitem zz1_QuickLaunchMenu_5") lat[i].style.fontSize = String((9+(tamanho_atual*2))+"px");
			if (lat[i].className == "zz1_QuickLaunchMenu_1 ms-navitem zz1_QuickLaunchMenu_5 ms-selectednav zz1_QuickLaunchMenu_11") lat[i].style.fontSize = String((9+(tamanho_atual*2))+"px");
		}
	}
	if (bread != null) bread.style.fontSize = String((8+(tamanho_atual*2))+"px");
}

//--------------------------------------------------------------------------------------------
function iconBand(caminho){
		url = location.href;
		url = url.toLowerCase();
		idiomaAtual = _Variations.Current.Title;
		urlLink = url.replace(idiomaAtual,caminho);
		if((idiomaAtual == "en-us") && (caminho == "pt-br" || caminho == "es-es")) urlLink = urlLink.replace("pages", "paginas");
		if(caminho == "en-us") urlLink = urlLink.replace("paginas", "pages");
		location.href = urlLink;
}

//---------SHOW/HIDE--------------------------------------------------------------------------
function abre(n) {
	obj1 = document.getElementById(n+"pergof").style.display = "none";
	obj2 = document.getElementById(n+"perfon").style.display = "block";
	obj3 = document.getElementById(n+"respos").style.display = "block";
}
function fecha(n) {
	obj1 = document.getElementById(n+"pergof").style.display = "block";
	obj2 = document.getElementById(n+"perfon").style.display = "none";
	obj3 = document.getElementById(n+"respos").style.display = "none";
}


function showHide(btShow,btclose,opentxt){
	obj1 = document.getElementById(btShow); obj1.style.display = "none";
	obj1 = document.getElementById(btclose); obj1.style.display = "block";
	obj1 = document.getElementById(opentxt); obj1.style.display = "block";
}
function closeHide(btShow,btclose,opentxt){
	obj1 = document.getElementById(btShow); obj1.style.display = "block";
	obj1 = document.getElementById(btclose); obj1.style.display = "none";
	obj1 = document.getElementById(opentxt); obj1.style.display = "none";
}
//---------------------------------------------------------------------------------------------
function titleBread(){
	if(navigator.appName.indexOf('Internet Explorer')>0){
	 var bread = document.getElementById("breadcrumb").innerText.split(">");
	    }else{
	 var bread = document.getElementById("breadcrumb").textContent .split(">");
	    }
	document.title = "";
	for(i=0; i < bread.length; i++){
			if(i == 1){
				document.title += "";
			} else if(i == ""+bread.length-1+""){
				document.title += bread[i];
			} else{
				document.title += bread[i];
				if (bread.length > 2) document.title += " : ";
			}
	}
}






