﻿// nuova Javascript funcions
// version: 2.0
// feb 2007
//

// ---------------------------------------------------------------------------------------
//  global variables definition
// ---------------------------------------------------------------------------------------

pageExtension = "htm";
pre_root = root.slice(3,root.length);

ar_area_pt = new Array();
ar_area_pt[0] = ["Institucional","Institucional", "","",[["O Grupo Votorantim","historiadogrupo", "GrupoVotorantim",""], ["Perfil","Perfil", "",""], ["Linha do Tempo","LinhaDoTempo", "",""], ["Unidades","unidades", "",""], ["Grandes Obras","Obras", "",""]]];
ar_area_pt[1] = ["Unidades","Unidades", "../hotsites/unidades/default_pt.htm","_blank",[]];
//ar_area_pt[2] = ["Produtos","Produtos", "", "",[["Agregados","Agregados", "",""], ["Argamassa","Argamassa", "",""], ["Cal","Cal", "",""], ["Cimento","Cimento", "",""], ["Concreto","Concreto", "",""]]];

ar_area_pt[2] = ["Produtos","Produtos", "", "",[["Cimento","Cimento", "",""],["Concreto","Concreto", "",""],["Agregados","Agregados", "",""]]];

ar_area_pt[3] = ["Canais de Atendimento","Servicos", "", "",[["SAC","SAC", "",""], ["CAC","CAC", "",""], ["SIC","SIC", "",""], ["Fornecedores e Transportadores","Fornecedores", "",""], ["VCIM","digasimvc", "http://www.digasimavc.com.br/","_blank"], ["Leilão Votorantim Cimentos","leilao", "",""]]];
ar_area_pt[4] = ["Gestão de Pessoas","Pessoas", "", "",[["Planejamento e Desenvolvimento","Desenvolvimento", "",""], ["Trabalhe Conosco","Curriculo", "",""]]];
ar_area_pt[5] = ["Desenvolvimento Sustentável","Responsabilidade", "", "",[["Social","Atividades", "",""], ["Econômico","Economico","",""], ["Ambiental","Ambiental","",""] ]];
ar_area_pt[6] = ["Sala de Imprensa","Imprensa", "", "",[["Notícias","Noticias", "",""], ["VC na Mídia","Midia", "",""], ["Contatos","Contato", "",""]]];

ar_area_en = new Array();
ar_area_en[0] = ["Institutional","institutional", "","",[["Group History ","grouphistory", "http://www.votorantim.com.br/PTB/O_Grupo_Votorantim/Historia/","_blank"], ["Votorantim Cimentos History","VotorantimCimentos", "",""], ["The Company","Profile", "",""], ["Units","Units", "",""], ["Big Construction","Constructions", "",""]]];
ar_area_en[1] = ["Unidades","Unidades", "../hotsites/unidades/default_en.htm","_blank",[]];
ar_area_en[2] = ["Products","Products", "", "",[["Aggregates","Aggregates", "",""], ["Mortar","Mortar", "",""], ["Lime","Lime", "",""], ["Cement","Cement", "",""]]];
ar_area_en[3] = ["Human Resources Management ","People", "", "",[["Planning and Development ","Development", "",""], ["Send your résumé","Resume", "",""]]];
ar_area_en[4] = ["Social and Environmental Responsibility","Responsibility", "", "",[["Main Activities","Activities", "",""], ["Excellence Policy","Excellence", "",""]]];
ar_area_en[5] = ["Press","Press", "", "",[["News","News", "",""]]];

ar_month_pt = new Array();
ar_month_pt[0] = "JAN";
ar_month_pt[1] = "FEV";
ar_month_pt[2] = "MAR";
ar_month_pt[3] = "ABR";
ar_month_pt[4] = "MAI";
ar_month_pt[5] = "JUN";
ar_month_pt[6] = "JUL";
ar_month_pt[7] = "AGO";
ar_month_pt[8] = "SET";
ar_month_pt[9] = "OUT";
ar_month_pt[10] = "NOV";
ar_month_pt[11] = "DEZ";

ar_month_en = new Array();
ar_month_en[0] = "JAN";
ar_month_en[1] = "FEB";
ar_month_en[2] = "MAR";
ar_month_en[3] = "APR";
ar_month_en[4] = "MAY";
ar_month_en[5] = "JUN";
ar_month_en[6] = "JUL";
ar_month_en[7] = "AUG";
ar_month_en[8] = "SEP";
ar_month_en[9] = "OCT";
ar_month_en[10] = "NOV";
ar_month_en[11] = "DEC";


// ---------------------------------------------------------------------------------------
//  default funcions
// ---------------------------------------------------------------------------------------


function popup(fileName,windowName,windowScrolling,windowWidth,windowHeight) {
	//
	var popXposition= ((screen.width - windowWidth) / 2);
	window.open (fileName,windowName,"toolbar=no,left=" + popXposition+ ",location=no,directories=no,status=no,menubar=no,scrollbars="+windowScrolling+",resizable=no,copyhistory=no,width="+windowWidth+",height="+windowHeight+"");
	//
}

function trace(param) {

	alert(param);

}

// ---------------------------------------------------------------------------------------
//  specific functions
// ---------------------------------------------------------------------------------------

function showSplash(lang,num) {
	if (lang == "pt") {
		document.write("<div class='homeAmb'><div class='AmbPosition' id='AmbPosition'>");
		Flash('bannerAmb', 754, 365, '', 'xmlpath=../flash/bannerAmb.xml|imgpath=../flash/banners'.replace(/\.\.\//g, root));
		document.write("</div></div>");
	} else if (lang == "en") {
		/*document.write("<div class='homeAmb'><div class='AmbPosition' id='AmbPosition'>");
		Flash('bannerAmb', 754, 365, '', 'xmlpath=../flash/bannerAmb.xml|language=_en-us|imgpath=../flash/banners'.replace(/\.\.\//g, root));
		document.write("</div></div>");*/
		
		if (num == 0) {
			var rd = Math.round(Math.random()*4)
			var myImage = root+'images/splash/splash_en_0'+rd+'.jpg'
		} else {
			var myImage = root+'images/splash/splash_en_00.jpg'
		}
		document.write( '<img src="'+myImage+'" width="780" height="207">' );
		
	}
}

function clickTag(sfwid) {
	//
	//
}

window.onresize= window.onload= function() {

  if (document.lang == "pt") {

    // hide unused line
    a= document.getElementsByTagName("td")
    for (i= 0; i < a.length; i++ ) {
      if ( (a[i].height == 29)  ) { // && ( a[i].innerHTML == "&nbsp;" )
        a[i].style.display= "none";
        break;
      }
    }

    document.getElementById("fundoBody").style.width= document.body.clientWidth;
    document.getElementById("linhaSuperior").style.width= document.body.clientWidth;
    document.getElementById("linhaInferior").style.width= document.body.clientWidth;

    document.getElementById("fundoBody").style.height= ( document.getElementById("linhaInferior").offsetTop - document.getElementById("linhaSuperior").offsetTop )
    document.getElementById("fundoBody").style.zIndex= -1;

    document.body.style.backgroundColor= "white"
    document.getElementsByTagName("table")[0].bgColor= "";

    positionMenuSeta();
  }

}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function assembleMenu(lang) {
document.lang= lang;

if (lang == "pt") {
  document.getElementById("site_top").style.height= 110;
  document.getElementById("main_menu").style.display= "none";
} else {
	//
	var ar_area = new Array();
	currentLang = lang;
	//
	if (lang == "pt") {
		//
		ar_area = ar_area_pt;
		//
	} else if (lang == "en") {
		//
		ar_area = ar_area_en;
		//
	}
	//
	//
	document.write('<div style="position:relative;z-index:10"><a href="'+pre_root+'default.'+pageExtension+'"><img name="menu_home" src="'+root+'images/layout/menu_top.gif" border="0" id="menu_home" /></a></div>');
	//
	for(var i =0;i<ar_area.length;i++) {
		//
		MM_preloadImages(root+"images/layout/menu_'"+lang+"'_'"+(i+1)+"'_b.gif");
		//
		if (ar_area[i][2] == "") {
			//var myLink = pre_root+ar_area[i][1]+"."+pageExtension;
			var myLink = '"'+pre_root+ar_area[i][1]+'/Default.'+pageExtension+'"';
		} else {
			var myLink = pre_root+ar_area[i][2];
		}
		if (ar_area[i][3] != "") {

			myLink+= ' target="'+ar_area[i][2]+'"';
		}
		//
		document.write('<div style="position:relative;z-index:'+(11+i)+'" onMouseOver="interact(\'main\',\'over\',\''+lang+'\','+i+')" onMouseOut="interact(\'main\',\'out\',\''+lang+'\','+i+')" ><a href='+myLink+'><img name="menu_'+i+'" src="'+root+'images/layout/menu_'+lang+'_'+(i+1)+'.gif" border="0" id="menu_'+i+'" />');
		//
		document.write('<div name="dv_menu'+i+'" id="dv_menu'+i+'" style="visibility:hidden; position:absolute;top:0 ; left:166;z-index:'+(101+i)+'">');
		if (ar_area[i][4].length >0) {
			//document.write('<div name="dv_menu'+i+'" id="dv_menu'+i+'" style="visibility:hidden; position:absolute;top:0 ; left:166;z-index:'+(101+i)+'">');
			//document.write('<table border="0" cellspacing="0" cellpadding="0"><tr><td height="0"><img src="'+root+'images/layout/spacer.gif" width="1" height="1"></td></tr>');
			for (var j = 0; j<ar_area[i][4].length; j++) {
				//
				if (ar_area[i][4][j][2] != "" && ar_area[i][4][j][3] != undefined) {
					var myTarget = "target='"+ar_area[i][4][j][3]+"'";
				} else {
					var myTarget = "";
				}
				//
				if (ar_area[i][4][j][2] == "") {
					var myLink = "href='"+pre_root+ar_area[i][1]+"/"+ar_area[i][4][j][1]+"."+pageExtension+"'"+myTarget;
				} else {
					var myLink = "href='"+ar_area[i][4][j][2]+"'"+myTarget;
				}
				//
					document.write('<div><a '+myLink+' onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'menu_'+lang+'_'+(i+1)+'_'+(j+1)+'\',\'\',\''+root+'images/layout/menu_'+lang+'_'+(i+1)+'_'+(j+1)+'_b.gif\',1);"><img name="menu_'+lang+'_'+(i+1)+'_'+(j+1)+'" src="'+root+'images/layout/menu_'+lang+'_'+(i+1)+'_'+(j+1)+'.gif"  border="0" id="menu_'+lang+'_'+(i+1)+'"_"'+(j+1)+'" /></a></div>');
					MM_preloadImages(root+"images/layout/menu_'"+lang+"'_'"+(i+1)+"'_'"+(j+1)+"'_b.gif");
			}
			//document.write('</table>');
			//document.write('</div>');
		}  else {
			//
			document.write('<img src="../images/layout/spacer.gif" width="1" height="1">');
			//
		}
		document.write('</div>');
		document.write('</div>');

	}

	//
	document.write('<div style="position:relative"><img name="menu_low" src="'+root+'images/layout/menu_low.gif" border="0" id="menu_low" /></div>');
	//
	//
}

}

var pt = "pt";
var en = "en";

var langAtual = "";

menuPt = new Array();
menuPt[0] = ["Home<br><br>", "javascript:goHome();" ]
menuPt[1] = ["Institucional<br><br>",pre_root + "Institucional/Perfil.htm"]
menuPt[2] = ["Produtos<br><br>",pre_root + "Produtos/Default.htm"]
menuPt[3] = ["Canais de <br>Atendimento",pre_root + "Servicos/Default.htm"]
menuPt[4] = ["Gestão de <br>Pessoas",pre_root + "Pessoas/Default.htm"]
menuPt[5] = ["Desenvolvimento <br>Sustentável",pre_root + "Responsabilidade/Default.htm"]
menuPt[6] = ["Sala de <br>Imprensa",pre_root + "Imprensa/Default.htm"]

subPt1 = new Array();
subPt1[0] = ["O Grupo Votorantim",pre_root + "Institucional/GrupoVotorantim.htm" ] // "http://www.votorantim.com.br/PTB/O_Grupo_Votorantim/Historia/", "_blank"
subPt1[2] = ["Perfil"         ,pre_root + "Institucional/Perfil.htm"]
subPt1[1] = ["Linha do Tempo" ,pre_root + "Institucional/LinhaDoTempo.htm"]
subPt1[3] = ["Unidades"       ,pre_root + "Institucional/unidades.htm"]
subPt1[4] = ["Grandes Obras"  ,pre_root + "Institucional/Obras.htm"]

subPt2 = new Array();
subPt2[0] = ["Negócio Cimento",pre_root + "Produtos/Cimento.htm"]
subPt2[1] = ["Negócio Concreto",pre_root + "Produtos/Concreto.htm"]
subPt2[2] = ["Negócio Agregados",pre_root + "Produtos/Agregados.htm"]
//subPt2[4] = ["Argamassa",pre_root + "Produtos/Argamassa.htm"]
//subPt2[3] = ["Cal",pre_root + "Produtos/Cal.htm"]

subPt3 = new Array();
subPt3[0] = ["SAC",pre_root + "Servicos/SAC.htm"]
subPt3[1] = ["CAC",pre_root + "Servicos/CAC.htm"]
subPt3[2] = ["SIC",pre_root + "Servicos/SIC.htm"]
subPt3[3] = ["Fornecedores e Transportadores",pre_root + "Servicos/Fornecedores.htm"]
subPt3[4] = ["VCIM", "http://www.digasimavc.com.br/", "_blank"]
subPt3[5] = ["Leilão Votorantim Cimentos",pre_root + "Servicos/leilao.htm"]

subPt4 = new Array();
subPt4[0] = ["Planejamento e Desenvolvimento",pre_root + "Pessoas/Desenvolvimento.htm"]
subPt4[1] = ["Trabalhe Conosco",pre_root + "Pessoas/Curriculo.htm"]

subPt5 = new Array();
subPt5[0] = ["Econômico",pre_root + "Responsabilidade/Economico.htm"]
subPt5[1] = ["Social",pre_root + "Responsabilidade/Social.htm"]
subPt5[2] = ["Ambiental",pre_root + "Responsabilidade/Ambiental.htm"]
// subPt5[1] = ["Política de Excelência",pre_root + "Responsabilidade/Excelencia.htm"]

subPt6 = new Array();
subPt6[0] = ["Notícias",pre_root + "Imprensa/Noticias.htm"]
subPt6[1] = ["VC na Mídia",pre_root + "Imprensa/Midia.htm"]
subPt6[2] = ["Contatos",pre_root + "Imprensa/Contato.htm"]

SubPt1_0 = new Array();
SubPt1_0[0] = ["Relatórios Anuais",pre_root + "Institucional/RelatoriosAnuais.htm"]

SubPt2_0 = new Array();
SubPt2_0[0] = ["Cimento",pre_root + "Produtos/Cimento.htm"]
SubPt2_0[1] = ["Argamassa",pre_root + "Produtos/Argamassa.htm"]
SubPt2_0[2] = ["Cal",pre_root + "Produtos/Cal.htm"]
SubPt2_0[3] = ["Calcário Agrícola",pre_root + "Produtos/Calcario_Agricola.htm"]


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

menuEn = new Array();
menuEn[0] = ["Home<br><br>", "javascript:goHome();" ]
menuEn[1] = ["Institutional<br><br>",pre_root + "Institucional/Perfil.htm"]
menuEn[2] = ["Products<br><br>",pre_root + "Produtos/Default.htm"]
menuEn[3] = ["Ombudsman<br><br>",pre_root + "Servicos/Default.htm"]
menuEn[4] = ["People<br>Management ",pre_root + "Pessoas/Default.htm"]
menuEn[5] = ["Sustainable<br>Development ",pre_root + "Responsabilidade/Default.htm"]
menuEn[6] = ["Press<br>Room",pre_root + "Imprensa/Default.htm"]

subEn1 = new Array();
subEn1[0] = ["O Grupo Votorantim",pre_root + "Institucional/GrupoVotorantim.htm" ] // "http://www.votorantim.com.br/PTB/O_Grupo_Votorantim/Historia/", "_blank"
subEn1[1] = ["Perfil"         ,pre_root + "Institucional/Perfil.htm"]
//subEn1[2] = ["Linha do Tempo" ,pre_root + "Institucional/LinhaDoTempo.htm"]
//subEn1[3] = ["Unidades"       ,pre_root + "Institucional/unidades.htm"]
//subEn1[4] = ["Grandes Obras"  ,pre_root + "Institucional/Obras.htm"]

subEn2 = new Array();
subEn2[0] = ["Negócio Cimento",pre_root + "Produtos/Cimento.htm"]
subEn2[1] = ["Negócio Concreto",pre_root + "Produtos/Concreto.htm"]
subEn2[2] = ["Negócio Agregados",pre_root + "Produtos/Agregados.htm"]
//subPt2[4] = ["Argamassa",pre_root + "Produtos/Argamassa.htm"]
//subPt2[3] = ["Cal",pre_root + "Produtos/Cal.htm"]

subEn3 = new Array();
/*
subEn3[0] = ["SAC",pre_root + "Servicos/SAC.htm"]
subEn3[1] = ["CAC",pre_root + "Servicos/CAC.htm"]
subEn3[2] = ["SIC",pre_root + "Servicos/SIC.htm"]
subEn3[3] = ["Fornecedores e Transportadores",pre_root + "Servicos/Fornecedores.htm"]
subEn3[4] = ["VCIM", "http://www.digasimavc.com.br/", "_blank"]
*/

subEn4 = new Array();
subEn4[0] = ["Planejamento e Desenvolvimento",pre_root + "Pessoas/Desenvolvimento.htm"]
subEn4[1] = ["Trabalhe Conosco",pre_root + "Pessoas/Curriculo.htm"]

subEn5 = new Array();
subEn5[0] = ["Econômico",pre_root + "Responsabilidade/Economico.htm"]
subEn5[1] = ["Social",pre_root + "Responsabilidade/Social.htm"]
subEn5[2] = ["Ambiental",pre_root + "Responsabilidade/Ambiental.htm"]
// subEn5[1] = ["Política de Excelência",pre_root + "Responsabilidade/Excelencia.htm"]

subEn6 = new Array();
subEn6[0] = ["Contatos",pre_root + "Imprensa/Contato.htm"]
//subEn6[0] = ["Notícias",pre_root + "Imprensa/Noticias.htm"]
//subEn6[1] = ["VC na Mídia",pre_root + "Imprensa/Midia.htm"]

SubEn1_0 = new Array();
SubEn1_0[0] = ["Relatórios Anuais",pre_root + "Institucional/RelatoriosAnuais.htm"]

SubEn2_0 = new Array();
SubEn2_0[0] = ["Cimento",pre_root + "Produtos/Cimento.htm"]
SubEn2_0[1] = ["Argamassa",pre_root + "Produtos/Argamassa.htm"]
SubEn2_0[2] = ["Cal",pre_root + "Produtos/Cal.htm"]
SubEn2_0[3] = ["Calcário Agrícola",pre_root + "Produtos/Calcario_Agricola.htm"]


function assembleAuxiliaryMenu(lang) {
if ( lang == "pt")  {
  // no
} else { // ENGLISH

	var ar_area = new Array();
	//var pageExtension = "htm";
	var currentLang = lang;
	ar_area[0] = ["SiteMap", "Map","",[]];
	ar_area[1] = ["Resume", "People/Resume","",[]];
	ar_area[2] = ["Contact", "Institutional/Contact", "",[]];
	document.write('<div style="position:relative">');
	for(var i =0;i<ar_area.length;i++) {
		if (ar_area[i][2] == "") {
			var myLink = pre_root+ar_area[i][1]+"."+pageExtension;
		} else {
			var myLink = pre_root+ar_area[i][2];
		}
		document.write('<a href="'+myLink+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'menuaux_'+lang+'_'+(i+1)+'\',\'\',\''+root+'images/layout/menuaux_'+lang+'_'+(i+1)+'_b.gif\',1);"><img name="menuaux_'+lang+'_'+(i+1)+'" src="'+root+'/images/layout/menuaux_'+lang+'_'+(i+1)+'.gif"  border="0" id="menuaux_'+lang+'_'+(i+1)+'" /></a>');
	}
	document.write('</div>');
}

}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// MENU COM SUBMENU - MENU CASCATA

timerSub = setTimeout(fechaSubs,1000);
timerSub2 = setTimeout(function() {} ,1000);

function fechaSubs() {
	if (langAtual == 'pt') var nLimit = menuPt.length;
	if (langAtual == 'en') var nLimit = menuEn.length;
	for (i=0;i<nLimit;i++) {
		objSub = document.getElementById("sub"+i);
		if ( objSub ) {
			objSub.style.display = "none";
		}
		objMenu = document.getElementById("menu"+i);
		if ( objMenu != undefined ) {
			objMenu.style.border = "1px solid #FFF";
			objMenu.style.background = "none";
			objMenu.style.borderBottom = "0px";
		}
		for (w=0;w<10;w++) {
			if (langAtual == 'pt') tempObjFor2 = "SubPt2_"+ w;
			if (langAtual == 'en') tempObjFor2 = "SubEn2_"+ w;
			if (eval("typeof("+tempObjFor2+")") != "undefined") {
				document.getElementById(tempObjFor2).style.display = "none";
			}
		}
	}
}

function overMenu(obj) {
	fechaSubs();
	subNum = obj.id.split("u")[1];
	objSub = document.getElementById("sub"+subNum);

	if ( objSub ) {
		objSub.style.display = "block";
		objMenu = document.getElementById("menu"+subNum);
		objMenu.style.border = "1px solid #BBB";
		objMenu.style.background = "#FFF";
		//objMenu.style.height = "20px";
		objMenu.style.borderBottom = "1px solid #FFF";
		clearTimeout(timerSub);
	}
}

function outMenu(obj) {
	timerSub = setTimeout(fechaSubs,500);
}

function overSub(obj) {
	obj.style.background = "#DDD"
	clearTimeout(timerSub);
	if (langAtual == 'pt') tempObj = obj.id.split("sub").join("SubPt");
	if (langAtual == 'en') tempObj = obj.id.split("sub").join("SubEn");
	for (w=0;w<20;w++) {
		tempObjFor = tempObj.split("_")[0] +"_"+ w;
		if (eval("typeof("+tempObjFor+")") != "undefined") {
			document.getElementById(tempObjFor).style.display = "none";
		}
	}
	if (eval("typeof("+tempObj+")") != "undefined") {
		document.getElementById(tempObj).style.display = "block";
	}
}

function outSub(obj) {
	obj.style.background = "#FFF"
	timerSub = setTimeout(fechaSubs,500);
	if (langAtual == 'pt') tempObj = obj.id.split("sub").join("SubPt");
	if (langAtual == 'en') tempObj = obj.id.split("sub").join("SubEn");
	if (eval("typeof("+tempObj+")") != "undefined") {
		//document.getElementById(tempObj).style.display = "none";
	}
}

function overSub2(obj) {
	clearTimeout(timerSub);
	clearTimeout(timerSub2);
}

function outSub2(obj) {
	tempObj2 = obj.id
	timerSub2 = setTimeout( function() { document.getElementById(tempObj2).style.display = "none" } ,500);
}

function trocaCorOver(objCor) {
	objCor.style.background = "#DDD"
}
function trocaCorOut(objCor) {
	objCor.style.background = "#FFF"
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function overSectionTab(obj) {
	obj.style.background = "#fff";
	obj.style.color="#666";
}
function outSectionTab(obj) {
	obj.style.color="#bbb";
	obj.style.background = "#f5f5f5";
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function interact(origin,action,lang,num) {
	if (origin == "main") {
		var mySubMenu = eval("dv_menu"+num)
		if (action == "over") {
			showHideLayer(mySubMenu, 1);
			movepic("menu_"+num,root+"images/layout/menu_"+lang+"_"+(num+1)+"_b.gif");
		} else if (action == "out") {
		showHideLayer(mySubMenu, 0);
			movepic("menu_"+num,root+"images/layout/menu_"+lang+"_"+(num+1)+".gif") ;
		}
	}
}

//

function assembleAreaNavigation(lang, num) {
	//
	//
	if (lang == "pt") {
		//
		ar_area = ar_area_pt;
		//
	} else if (lang == "en") {
		//
		ar_area = ar_area_en;
		//
	}
	var cols = 3
	var lines = Math.ceil(ar_area[num-1][4].length/3);
	var total = lines*cols
	var opentag = false;
	//
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	//
	for(var i=0;i<total;i++) {
		//
		if (i%cols ==0){
			if (opentag == false) {
				document.write('<tr>');
				opentag = true;
			} else {
				document.write('</tr>');
				document.write('<tr><td height ="10"></td></tr>');
				opentag = false;
			}
		}

		if (i < ar_area[num-1][4].length) {
			//
				if (ar_area[num-1][4][i][2] != "" && ar_area[num-1][4][i][3] != undefined) {
					var myTarget = "target='"+ar_area[num-1][4][i][3]+"'";
				} else {
					var myTarget = "";
				}
				//
				if (ar_area[num-1][4][i][2] == "") {
					//var myLink = "href='"+pre_root+ar_area[num-1][1]+"_"+ar_area[num-1][4][i][1]+"."+pageExtension+"'"+myTarget;
					var myLink = "href='"+ar_area[num-1][4][i][1]+"."+pageExtension+"'"+myTarget;
				} else {
					var myLink = "href='"+ar_area[num-1][4][i][2]+"'"+myTarget;
				}
			//
			var myText = "> <a "+myLink+" class='content_text'>"+ar_area[num-1][4][i][0]+"</a>";
			//ar_area[num-1][4][i][0])
			//var myText = ar_area[num-1][4][i][0]
			//
		} else {
			var myText = "";
		}
		document.write('<td width="33%" class="content_text">'+myText+'</td>');


		//
	}
	document.write('</table>');

	//
}
//
//
function assembleTop(lang,bt_back,bt_print,title,url,subtitle) {
	//
	if (lang == "pt") {
		var goback = "voltar";
	} else if (lang == "en") {
		var goback = "back";
	}
	//
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="6">');
	document.write('<tr height="28">');
	// document.write('<td width="13" align="center"><img src="'+root+'images/layout/bullet_orange.gif" width="11" height="13"></td>');

	if (url == undefined) {
		url = "#";
	}
  document.write('<td>');

	// document.write('<td class="title_text" height="24"><a href="'+url+'" class="title_text">'+title+'</a>');

	if (subtitle != undefined) {
		document.write('<span class="subTitle_text">&nbsp;&nbsp;&nbsp;&nbsp;'+ subtitle +'</span>');
	} else {
	  document.write('<a href="'+url+'" class="title_text">'+title+'</a>');
	}
	document.write('</td>');
	if (bt_back == true) {
		document.write('<td width="45" class="title_text"><a href="javascript:history.back();" class="goback_text">&lt;&lt; '+goback+'</a></td>');
	}
	if (bt_print == true) {
		document.write('<td width="30"  class="title_text"><a href="javascript:printPage();" ><img src="'+root+'images/layout/ico_print.gif" border="0"></a></td>');
	}

	document.write(' </tr>');
	document.write(' </table>');
	//
}
//
//
function assembleSide(image,title) {
		document.write(' <table border="0" cellspacing="0" cellpadding="0" width="148">');

		document.write('  <tr height="28" >');
		document.write(' <td width="10"></td>');
		document.write(' <td width="138">'); // background="'+root+'images/layout/side_bg.gif"
		document.write('  <table width="100%" border="0" cellspacing="4" cellpadding="0">');
		document.write('    <tr>');
		// document.write('      <td align="center" valign="top"><img src="'+root+'images/layout/side_bullet.gif" width="7" height="7"></td>');
		document.write('      <td class="side_text">&nbsp;');
		if(title != undefined) {
			document.write(title);
		}
		document.write(' </td>');
		document.write('</tr>');
		document.write('  </table></td>');
		document.write(' </tr>');
		document.write('  <tr>');
		document.write('  <td width="10"></td>');
		document.write('  <td width="138">');
		if (image != undefined) {
			document.write(' <img src="'+image+'" width="138">');
		}
		document.write(' </td>');
		document.write(' </tr>');
		document.write('<tr>');
		document.write('  <td colspan="2">&nbsp;</td>');
		document.write(' </tr>');
		document.write(' </table><br>');
}
//
function assembleSubMenu(val,active) {
	//
	var ar_temp = val.split("|");
	var ar_area = new Array();

	for(var i =0;i<ar_temp.length;i++) {
		//
		ar_area.push(ar_temp[i].split(";"));
		//
	}
	//
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="20" height="35">&nbsp;</td><td class="subMenu_text">')
	//
	for(var i=0; i<ar_area.length;i++) {
		//
		if(i+1 == active) {
			document.write('<a href="'+ar_area[i][1]+'" class="subMenu_text_selected">'+ar_area[i][0]+'</a>');
		} else {
			document.write('<a href="'+ar_area[i][1]+'" class="subMenu_text">'+ar_area[i][0]+'</a>');
		}
		if (i<ar_area.length-1) {
			document.write(' | ');
		}

		//
	}
	document.write('</td><td width="20">&nbsp;</td></tr></table>');
	//
}
//
function assembleSiteMap(lang) {
	//
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	//
	if (lang == "pt") {
		//
		ar_area = ar_area_pt;
		//
	} else if (lang == "en") {
		//
		ar_area = ar_area_en;
		//
	}
	//
	for(var i =0;i<ar_area.length;i++) {

		document.write('<tr>');
		document.write('<td>');
		//
		document.write('<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#E0D4C8" >');
		document.write('  <tr align="center" bgcolor="#F7F3EF">');
		document.write('	<td height="20" colspan="'+ar_area[i][4].length+'" class="map_title"><b>'+ar_area[i][0]+'</b></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" bgcolor="#FFFBF7" >');
		// subareas
		for (var j = 0; j<ar_area[i][4].length; j++) {
			//
				if (ar_area[i][4][j][2] != "" && ar_area[i][4][j][3] != undefined) {
					var myTarget = "target='"+ar_area[i][4][j][3]+"'";
				} else {
					var myTarget = "";
				}
				//
				if (ar_area[i][4][j][2] == "") {
					var myLink = "href='"+pre_root+ar_area[i][1]+"/"+ar_area[i][4][j][1]+"."+pageExtension+"'"+myTarget;
				} else {
					var myLink = "href='"+ar_area[i][4][j][2]+"'"+myTarget;
				}
			//
			document.write('	<td width="'+(100/ar_area[i][4].length)+'%" height="25"><a '+myLink+' class="map_text">'+ar_area[i][4][j][0]+'</a></td>');
			//
		}
		// end for subareas
		document.write('  </tr>');
		document.write('</table>');

		//
		document.write('</td>');
		document.write('  </tr>');
		document.write(' <tr>');
		document.write('<td>&nbsp;</td>');
		document.write(' </tr>');

	}
	document.write('</table>');
	//
}
//
function assembleFooter(lang) {

  // document.getElementById("linhaInferior").style.width= document.body.clientWidth;

  var footerHTMLpt= '                    \
    <div id="rodape">                  \
      <div class="centraliza">         \
      	<div id="rodape_conj">         \
              <div id="coluna">        \
                  <div class="linha"><a href="#" onclick="addToFavorites();"><img class="img_linha" src="../images/layout/ico_favoritos.gif" alt="Adicione aos Favoritos" />Adicione aos favoritos</a></div>           \
                  <div class="linha"><a href="[pre-root]Mapa.htm"><img class="img_linha" src="../images/layout/ico_mapa.gif" alt="Mapa do site" />Mapa do site</a></div>                                                  \
              </div>                   \
              <div id="coluna">        \
                  <div class="linha"><a href="[pre-root]Institucional/Contato.htm"><img class="img_linha" src="../images/layout/ico_mensagem.gif" alt="Contatos" />Contatos</a></div>                                     \
                  <div class="linha"><a href="[pre-root]Institucional/Contato_Ouvidoria.htm"><img class="img_linha" src="../images/layout/ico_ouvidoria.gif" alt="Ouvidoria" />Ouvidoria</a></div>                       \
              </div>                   \
              <div id="coluna">        \
                  <div class="linha"><a href="[pre-root]Pessoas/Curriculo.htm"><img class="img_linha" src="../images/layout/ico_carreira.gif" alt="Carreira" />Carreira</a></div>                                         \
                  <div class="linha"><a href="[pre-root]Servicos/Fornecedores.htm"><img class="img_linha" src="../images/layout/ico_fornecedores.gif" alt="Fornecedores" />Fornecedores</a></div>                         \
              </div>                   \
              <div id="coluna">        \
                  <div class="linha"><a href="http://www.institutovotorantim.org.br/pt-br/Paginas/home.aspx" target="_blank"><img class="img_linha" src="../images/layout/ico_Itv.gif" alt="Instituto Votorantim" />Instituto Votorantim</div> \
                  <div class="linha"><a href="http://www.memoriavotorantim.com.br/memoria/" target="_blank"><img class="img_linha" src="../images/layout/icoProjetoMemoria.gif" alt="Projeto Memória" />Projeto Memória</a></div>            \
              </div>                   \
			  <div id="coluna">        \
                  <div class="linha"><a href="[pre-root]Servicos/leilao.htm"><img class="img_linha" src="../images/layout/icoLeilao.gif" alt="Leilão Votorantim Cimentos" />Leilão VC</a></div>            \
              </div>                   \
              <div id="copyright">     \
                  <div class="linha">&copy; 2009 - Grupo Votorantim.<br>Todos os direitos reservados.</a></div>                                           \
                  <div class="linha"><a href="http://www.nuova.com.br" target="_blank">by	!n</span></a></div>                                                                                                          \
              </div>                   \
  		</div> \
      </div> \
  </div> \
  '
  var footerHTMLen= '                    \
    <div id="rodape">                  \
      <div class="centraliza">         \
      	<div id="rodape_conj">         \
              <div id="coluna">        \
                  <div class="linha"><a href="#" onclick="addToFavorites();"><img class="img_linha" src="../images/layout/ico_favoritos.gif" alt="Add to favorites" />Add to favorites</a></div>           \
                  <div class="linha"><a href="[pre-root]Mapa.htm"><img class="img_linha" src="../images/layout/ico_mapa.gif" alt="Site map" />Site map</a></div>                                                  \
              </div>                   \
              <div id="coluna">        \
                  <div class="linha"><a href="[pre-root]Institucional/Contato.htm"><img class="img_linha" src="../images/layout/ico_mensagem.gif" alt="Contacts" />Contacts</a></div>                                     \
                  <div class="linha"><a href="[pre-root]Institucional/Contato_Ouvidoria.htm"><img class="img_linha" src="../images/layout/ico_ouvidoria.gif" alt="Ombudsman" />Ombudsman</a></div>                       \
              </div>                   \
              <div id="coluna">        \
                  <div class="linha"><a href="[pre-root]Pessoas/Curriculo.htm"><img class="img_linha" src="../images/layout/ico_carreira.gif" alt="Career" />Career</a></div>                                         \
                  <div class="linha"><a href="http://www.institutovotorantim.org.br/pt-br/Paginas/home.aspx" target="_blank"><img class="img_linha" src="../images/layout/ico_Itv.gif" alt="Votorantim Institute" />Votorantim Institute</a></div> \
              </div>                   \
              <div id="copyright">     \
                  <div class="linha">&copy; 2009 - Votorantim Group.<br>All rights reserved.</a></div>               \
                  <div class="linha"><a href="http://www.nuova.com.br" target="_blank">by	!n</span></a></div>             \
              </div>                   \
  		</div> \
      </div> \
  </div> \
  '
  
  if ( lang == "pt" ) {
    document.write( '<div id="linhaInferior">&nbsp;</div>');
    document.write( footerHTMLpt.replace(/\.\.\//g, root).replace(/\[pre\-root\]/g, pre_root) )
  } 
  /*if ( lang == "en" ) {
    document.write( '<div id="linhaInferior">&nbsp;</div>');
    document.write( footerHTMLen.replace(/\.\.\//g, root).replace(/\[pre\-root\]/g, pre_root) )
  } */
  
  else {
  	document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0" background="'+root+'/images/layout/bg_footer.gif">');
        document.write('<tr>');
          document.write('<td align="right"><img src="'+root+'images/layout/copyright_'+lang+'.gif"></td>');
       document.write(' </tr>');
     document.write('</table>');
  }

}

function assembleSiteTop(lang) {
	var montaHTML= ""
	
	langAtual = lang;

	if ( lang == "pt" ) {
		var qtdeMenu = menuPt.length;
	
		// Monta Ferramentas
		montaHTML= '\
		<div id="topo">                                     \
		  <div class="centraliza">                          \
			<div id="topo_ferramentas">                     \
				<div id="topo_idiomas">                       \
				Idiomas                                     \
				<a href="javascript:changeLanguage(\'pt\');"><img src="../images/layout/topo_band_ptb.gif" alt="Português" border="0" style="left:9px;" /></a><a href="javascript:changeLanguage(\'en\');"><img src="../images/layout/topo_band_ing.gif" alt="Inglês" border="0" style="left:18px;" /></a> \
			  </div>                                        \
			  <div id="topo_form">                          \
				<select name="sitesSelector" class="sitesSelector" onChange="comboSelect(this,true);">              \
					<option value="">Sites Votorantim</option>                                                      \
					<option value="http://www.citrovita.com.br/"> Citrovita</option>                                \
					<option value="http://www.vcp.com.br/">Celulose e Papel</option>                                \
					<option value="http://www.votorantim-cimentos.com/"> Cimentos</option>                          \
					<option value="http://www.venergia.com.br/"> Energia</option>                                   \
					<option value="http://www.votorantimfinancas.com.br/home/index.jsp"> Finan&#231;as</option>     \
					<option value="http://www.vmetais.com.br"> Metais</option>                                      \
					<option value="http://www.nitroquimica.com.br"> Qu&#237;mica</option>                           \
					<option value="http://www.vsiderurgia.com.br/"> Siderurgia</option>                             \
					<option value="http://www.vnnegocios.com.br/"> Novos Neg&#243;cios</option>                     \
					<option value="http://www.institutovotorantim.org.br"> Instituto Votorantim</option>            \
					<option value="http://www.funsejem.org.br"> Funsejem</option>                                   \
					<option value="http://www.memoriavotorantim.com.br/memoria/"> Mem&#243;ria Votorantim</option>  \
				</select>                                   \
			  </div>                                        \
			</div>                                          \
			<div class="topo_logo">                         \
			  <a href="javascript:goHome();"><img src="../images/layout/logo_novo.gif" width="174" height="40" border="0" alt="Votorantim Cimentos"></a> \
			</div>                                          \
			<div id="topo_menu">                            \
			<br><br> \
		';
		montaHTML= montaHTML.replace(/\.\.\//g, root);
	
		// Monta menu
		montaHTML+= "<div class='menuTopoArea'>"
		montaHTML+= "<div id='menuTopoPosition' style='left: 195px; width: 598px;'>"
		for (i=0;i<qtdeMenu;i++) {
			if (i > 0) montaHTML+= "<div class='menuTopoDivisao'><img src='' style='visibility:hidden' width='1' height='1' /></div>"
			montaHTML+= "<div class='menuTopoObj'>"
			montaHTML+= "<div id='menu"+i+"' onMouseOver='overMenu(this)' onMouseOut='overMenu(this)' class='menuTopoItem' style='position: relative; z-index: 1000;'>"
			montaHTML+= "<a href='" + menuPt[i][1] + "'>" + menuPt[i][0] + "</a></div>"
			if (i > 0) {
				if (eval("subPt"+i)[0] != undefined) {
					montaHTML+= "<div id='sub"+i+"' class='menuTopoSubmenu' style='left: "
					if (i == (qtdeMenu-1)) montaHTML+= "-118px;'>"; else montaHTML+= "-6px;'>";
					for (w=0;w<eval("subPt"+i).length;w++) {
						montaHTML+= "<a href='"+eval("subPt"+i)[w][1]+"' " +  ( eval("subPt"+i)[w][2] ? "target='" + eval("subPt"+i)[w][2] + "'": "" ) + ">"
						montaHTML+= "<div id='sub"+i+"_"+w+"' onMouseOver='overSub(this)' onMouseOut='outSub(this)' "
						montaHTML+= "class='menuTopoSubmenuItem'>"+eval("subPt"+i)[w][0]+"</div></a>"
						// - - - - - - - - - - - - - - - - - - - - -
						if (eval("typeof(SubPt"+i+"_"+w+")") != "undefined") {
							montaHTML+= "<img src='"+root+"images/layout/menuArrow.gif' style='position: absolute; top: 7px; left: 185px;'></img>"
							montaHTML+= "<div id='SubPt"+i+"_"+w+"' style='display: none; position: absolute; left: 0px;' onMouseOver='overSub2(this)' onMouseOut='outSub2(this)'>"
							montaHTML+= "<div style='position: absolute; top: -25px; left: 198px; width: 200px; background: #FFF; "
							montaHTML+= "border: 1px solid #BBB; border-bottom: 0px;'>"
							for (k=0;k<eval("SubPt"+i+"_"+w).length;k++) {
								montaHTML+= "<a href='"+eval("SubPt"+i+"_"+w)[k][1]+"'><div class='menuTopoSubmenuItem' onMouseOver='trocaCorOver(this)' onMouseOut='trocaCorOut(this)'>"
								montaHTML+= eval("SubPt"+i+"_"+w)[k][0]+"</div></a>"
							}
							montaHTML+= "</div></div>"
						}
						// - - - - - - - - - - - - - - - - - - - - -
					}
					montaHTML+= "</div>"
				}
			}
			montaHTML+= "</div>";
		}
		montaHTML+= "</div></div>"
		montaHTML+= "</div></div></div>"
	
		montaHTML+= "<div id='fundoBody'>&nbsp;</div><div id='linhaSuperior'>&nbsp;</div>"
	
		document.write(montaHTML)
	
		// inclui a tag de menuseta
	
		document.write("<div id='menuSeta'>");
		Flash('menuSeta', 20, 20, '');
		document.write("</div>");

	} else {
	document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0" background="'+root+'images/layout/deg_top.jpg">');
      document.write('<tr>');
       document.write(' <td height="19" align="right"><table border="0" cellspacing="0" cellpadding="0">');
         document.write(' <tr>');
		 if (lang == "pt") {
			document.write(' <td width="26"><a href="javascript:changeLanguage(\'en\');"><img src="'+root+'images/layout/flag_usa.gif" width="15" height="10" border="0"></a></td>');
           	document.write(' <td width="15"><img src="'+root+'images/layout/flag_br.gif" width="15" height="10" border="0"></td>');
		 } else if (lang == "en") {
			document.write(' <td width="26"><img src="'+root+'images/layout/flag_usa.gif" width="15" height="10" border="0"></td>');
           document.write(' <td width="15"><a href="javascript:changeLanguage(\'pt\');"><img src="'+root+'images/layout/flag_br.gif" width="15" height="10" border="0"></a></td>');
		 }

           document.write(' <td width="21">&nbsp;</td>');
         document.write(' </tr>');
       document.write(' </table></td>');
     document.write(' </tr>');
   document.write(' </table>');
	}
	
}

function positionMenuSeta() {

  var secao= ""
  var tmpArr= new Array();
  var secaoId= 0;
  var xpos= 0;

  // posiciona
  for (var i= 0; i < menuPt.length; i++) {
    tmpArr= menuPt[i][1].split("/")
    secao= "/" + tmpArr[ tmpArr.length -2 ] + "/";
    if ( location.pathname.search(secao) > -1 ) {
      secaoId= i;
      break;
    }
  }

  xpos= document.getElementById("menuSeta").offsetLeft
      + document.getElementById( "menuTopoPosition" ).offsetLeft
      + document.getElementById( "menu"+secaoId ).offsetParent.offsetLeft
      + ( document.getElementById( "menu"+secaoId ).offsetParent.offsetWidth / 2)
      - 10;
  document.getElementById("menuSeta").style.left= xpos;

}

function xmlMicoxLoader(url)
{

    if(window.XMLHttpRequest)
    {
        var Loader = new XMLHttpRequest();
        Loader.open("GET", url ,false);
        Loader.send(null);
        return Loader.responseXML;


     }
     else if(window.ActiveXObject)
     {
        var Loader = new ActiveXObject("Msxml2.DOMDocument.3.0");
        Loader.async = false;
        Loader.load(url);
        return Loader;

    }

}

//
//

function assemblePress(lang, type) {

	var myFile = type+".xml";
	xmlDoc = xmlMicoxLoader(myFile);
	//
	if (lang == "pt") {
		var var_y = "Ano";
		var var_m = "Mes";
		var file_detail = type+"_Ver"
	} else if (lang == "en") {
		var var_y = "Year";
		var var_m = "Month";
		var file_detail = type+"_View"
	}

	//
	//
	var objNodeList = xmlDoc.getElementsByTagName("category");
	var objNode = objNodeList[1];
	//
	//
	var ar_area = new Array();
	//
	//
	for (var i = 0; i<objNodeList.length; i++) {
		//
		var z = objNodeList[i].getElementsByTagName("subCategory");
		//alert(objNodeList[i].getAttribute('year'))
		//
		var ar_temp = new Array();
		//
		for (var j = 0; j<z.length; j++) {
			//
			//alert(z[j].getAttribute('month'))
			//
			var ar_temp2 = new Array();
			//
			var y = z[j].getElementsByTagName('item');
			for (var k = 0; k<y.length; k++) {
				//alert(y[k].getAttribute('title'));
				ar_temp2.push([y[k].getAttribute('title'), y[k].getAttribute('txt'), y[k].getAttribute('file'), y[k].getAttribute('source'), y[k].getAttribute('date')]);
			}
			//
			ar_temp.push([z[j].getAttribute('month'), ar_temp2]);
			//
			//
		}
		//
		ar_area.push([objNodeList[i].getAttribute('year'), ar_temp]);
		//
	}
	var hashes = window.location.href.split('?')[1];
	//
	if (hashes != undefined) {
		//
		var spliter = hashes.split("&");
		//
		var current_year = spliter[0].split("=")[1];
		//
		if (spliter[1] != undefined) {
			var current_month = spliter[1].split("=")[1];
		}
		//
	} else {
		var current_year = ar_area[0][0];
		var current_month = undefined;
	}
	//

	//
	// assemble layout
	//
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('  <tr>');
	document.write('	<td><table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('	  <tr>');
	document.write('		<td>');

	// for do combo
	document.write('<select name="select" class="form_text" onChange="MM_jumpMenu(this,0)" >');
	//
	for (var i = 0; i<ar_area.length; i++) {
		if (ar_area[i][0] == current_year) {
			document.write('<option selected>'+ar_area[i][0]+'</option>');
			var current_year_pos = i;
		} else {
			document.write('<option value="'+type+'.'+pageExtension+'?'+var_y+'='+ar_area[i][0]+'">'+ar_area[i][0]+'</option>');
		}
	}
	document.write('</select>');
	document.write('</td>');
	document.write('		<td align="right" bgcolor="#E5E5E5">');

	// for month
	if (current_year_pos == undefined) {
		current_year_pos = 0;
	}

	//
	var ar_month_aval = new Array();
	//
	for (var i = 0; i<ar_area[current_year_pos][1].length; i++) {
		//
		if (current_month == ar_area[current_year_pos][1][i][0]) {
			//

			var initial_month = i;
			//
		}
		ar_month_aval.push(Number(ar_area[current_year_pos][1][i][0])-1);
		//
	}
	//
	if (initial_month == undefined) {
		initial_month = 0;
		current_month = ar_area[current_year_pos][1][0][0];
	}
	//
	//
	if (current_month == undefined) {
		current_month_pos = 0
	} else {
		current_month_pos = Number(current_month)-1;
	}
	//
	var ar_month = eval("ar_month_"+lang);

	//
	for (var i = 0; i<ar_month.length; i++) {

		var available = false;

		for (var j = 0; j<ar_month_aval.length; j++) {
			//
			//alert("i = "+i+" ar = "+ar_month_aval[j])
			if (i == ar_month_aval[j]) {
				var available = true;
			}
			//
		}
		//
		if (available == true) {
			//
			if (i == current_month_pos) {
				document.write('<span class="news_month_selected">'+ar_month[i]+'</span>');
			} else {
				document.write('<a href="'+type+'.'+pageExtension+'?'+var_y+'='+current_year+'&'+var_m+'='+(i+1)+'" class="news_month">'+ar_month[i]+'</a>');
			}
			//
		} else {
			document.write('<span class="news_month_inactive">'+ar_month[i]+'</span>');
		}
		//
		if (i<ar_month.length-1) {
			document.write('<span class="news_month">&nbsp; | &nbsp;</span>');
		} else {
				document.write('<span class="news_month">&nbsp;&nbsp;&nbsp;</span>');
		}
		//
	}

	document.write('			   </td>');
	document.write('	  </tr>');
	document.write('	</table></td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('	<td>&nbsp;</td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('	<td>');

	// for content
	//
	//
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr><td height="1" background="'+root+'images/layout/dotline.gif"></td></tr>');

	for (var i = 0; i<ar_area[current_year_pos][1][initial_month][1].length; i++) {
		//
		if (i%2 == 0) {
			var bgColor = "#FAFAFA"
		} else {
			var bgColor = "#FFFFFF"
		}
		//
		// document.write('<tr><td height="6" bgcolor="'+bgColor+'"></td></tr>');
		// document.write('<tr><td bgcolor="'+bgColor+'" onMouseOver="this.bgColor=\'#F3F2EA\'" onMouseOut="this.bgColor=\''+bgColor+'\'" onclick="location.href=\''+file_detail+'.asp?obj='+ar_area[current_year_pos][1][initial_month][1][i][2]+'\'">');
		document.write('<tr><td bgcolor="'+bgColor+'" onMouseOver="this.bgColor=\'#F3F2EA\'" onMouseOut="this.bgColor=\''+bgColor+'\'" onclick="location.href=\''+file_detail+'.asp?obj='+ar_area[current_year_pos][1][initial_month][1][i][2]+'\'">');

  		document.write('<div class="news_font" style="cursor:pointer; cursor:hand; width:586;" >'); // position:relative;
  		document.write('<div class="news_font" style="width:482;height:6"></div>'); // position:relative;

  		if (ar_area[current_year_pos][1][initial_month][1][i][4] != undefined && ar_area[current_year_pos][1][initial_month][1][i][4] != "") {
  			document.write('<div class="news_title" style="width:72px; float:left;" >'+ar_area[current_year_pos][1][initial_month][1][i][4]+' -</div>');
  		}

  		/** **/
  		document.write('<div class="news_title" style="*margin:0 0 0 0; margin:0px 0 12px 0; padding:0 0 0 0px; width:482;" >'+ar_area[current_year_pos][1][initial_month][1][i][0]+'</span><br><span class="news_text">'+ar_area[current_year_pos][1][initial_month][1][i][1]+'</span></div>');
  		/** **/

  		if (ar_area[current_year_pos][1][initial_month][1][i][3] != undefined && ar_area[current_year_pos][1][initial_month][1][i][3] != "") {
  			document.write('<div class="news_font" style="margin:10px 0 10px 0; padding:0 0 0 72px; width:492;" align="right">'+ar_area[current_year_pos][1][initial_month][1][i][3]+'</div>');
  		}
  		document.write('<div class="news_font" style="width:482;height:6"></div>');
  		document.write('</div>');

		document.write('</td></tr>');
		document.write('<tr><td height="1" background="'+root+'images/layout/dotline.gif"></td></tr>');
		//
	}
	document.write('</table>');

	document.write('  </td>');
	document.write('  </tr>');
	document.write('</table>');
}



//
function showPress() {
	//
	var hashes = window.location.href.split('?')[1];
	var myFile= hashes+"."+pageExtension;
	//
	//document.write('<!--#include file="News080808.htm" -->ax');

	document.write('<IFRAME name=content src="'+myFile+'" frameBorder="no" width="100%" height="100%" scrolling="no" allowtransparency="true"></IFRAME>');
	//
}
//
//
//

function MM_jumpMenu(selObj,restore){
  eval("location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//

function goHome() {
	//
	location.href = pre_root+"Default."+pageExtension;
	//
}

//

function printPage() {
	//
	window.print();
	//
}
//
//
function changeLanguage(lang) {
	//
	if (lang == "pt") {
		location.href = root+"htms-ptb";
	} else if (lang == "en") {
		location.href = root+"htms-enu";
	}
	//
}



function movepic(img_name,img_src) {
	document[img_name].src=img_src;
}

function showHideLayer(object, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[object].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {

        var obj = document.getElementById(object);
       object.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[object].style.visibility = iState ? "visible" : "hidden";
    }
}

// ---------------------------------------------------------------------------------------
//  fireworks over behaviors
// ---------------------------------------------------------------------------------------



function MM_findObj(n, d) { //v4.01

	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;

}

function MM_swapImgRestore() { //v3.0

	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_preloadImages() { //v3.0

	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

function MM_preloadImages2() { //v3.0

	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

// ---------------------------------------------------------------------------------------
// flash detect
// ---------------------------------------------------------------------------------------


// initialize global variables

var detectableWithVB = false;
var pluginFound = false;
var MinimalVersion= 8;

// functions

function redirectCheck(pluginVersion, pluginFound, SWF_NAME, SWF_WIDTH, SWF_HEIGHT, SWF_BGCOLOR, SWF_QUALITY, SWF_WMODE, SWF_ID, SWF_VARS) {

	if( pluginFound ) {
		// Verify version
		if(pluginVersion >= MinimalVersion) {

			var myVars = SWF_VARS+"&object_id="+SWF_ID;

			document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" VIEWASTEXT id='+SWF_ID+' name='+SWF_ID+' width="'+ SWF_WIDTH +'" height="'+ SWF_HEIGHT +'" wmode="'+SWF_WMODE+' swLiveConnect="TRUE" showMenu="false">');
			document.writeln('<PARAM NAME=movie VALUE="'+SWF_NAME+'" >');
			document.writeln('<PARAM NAME=FlashVars VALUE="'+myVars+'">');
			document.writeln('<PARAM NAME=quality VALUE="'+SWF_QUALITY+'">');
			document.writeln('<PARAM NAME="wmode" VALUE="'+SWF_WMODE+'" >');
			document.writeln('<PARAM NAME=scale VALUE=noscale> ');
			document.writeln('<PARAM NAME="showMenu" VALUE="false">');
			document.writeln('<PARAM NAME="bgcolor" value="'+SWF_BGCOLOR+'">');
			document.writeln('<EMBED src="' + SWF_NAME + '" showMenu="false" name="'+SWF_ID+'" FlashVars="'+myVars+'" swLiveConnect="TRUE" width="'+ SWF_WIDTH +'" height="'+ SWF_HEIGHT +'" type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" bgcolor="' + SWF_BGCOLOR + '" quality="' + SWF_QUALITY + '" wmode="'+SWF_WMODE+'"></EMBED>');
			document.writeln('</OBJECT>');

		} else {

			noFlashFound();
		}

    } else {

		noFlashFound();
    }
}

function detectFlash( SWF_NAME, SWF_WIDTH, SWF_HEIGHT, SWF_BGCOLOR, SWF_QUALITY, SWF_WMODE, SWF_ID, SWF_VARS) {
    pluginFound = detectPlugin('Shockwave','Flash');

    // if not found, try to detect with VisualBasic
    if( !pluginFound && detectableWithVB ) {
		pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.' + versionFlash() );
    }
	pluginVersion = versionFlash();
    // check for redirection
    return redirectCheck(pluginVersion, pluginFound, SWF_NAME, SWF_WIDTH, SWF_HEIGHT, SWF_BGCOLOR, SWF_QUALITY, SWF_WMODE, SWF_ID, SWF_VARS);
}

function versionFlash() {
	var sAux = 8;

	for( i = 10; i > 2; i-- ) {

		pluginFound = detectPlugin('Shockwave Flash ' + i);
		// if not found, try to detect with VisualBasic
		if(!pluginFound && detectableWithVB) {
			pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.' + i);
		}
		if ( pluginFound ) {
			sAux = i;
			break;
		}
	}

	return sAux;
}

function detectPlugin() {

    // allow for multiple checks in a single pass
    var daPlugins = detectPlugin.arguments;

    // consider pluginFound to be false until proven true
    var pluginFound = false;

    // if plugins array is there and not fake
    if (navigator.plugins && navigator.plugins.length > 0) {
		var pluginsArrayLength = navigator.plugins.length;

		// for each plugin...
		for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {

			// loop through all desired names and check each against the current plugin name
			var numFound = 0;
			for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {

				// if desired plugin name is found in either plugin name or description
				if( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) ||
					(navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {
					// this name was found
					numFound++;
				}
			}

			// now that we have checked all the required names against this one plugin,
			// if the number we found matches the total number provided then we were successful
			if(numFound == daPlugins.length) {
				pluginFound = true;
				// if we've found the plugin, we can stop looking through at the rest of the plugins
				break;
			}
		}
    }

    return pluginFound;

} // detectPlugin

// Here we write out the VBScript block for MSIE Windows
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<script language="VBscript">');

    document.writeln('\'do a one-time test for a version of VBScript that can handle this code');
    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');

    document.writeln('\'this next function will detect most plugins');
    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');

    document.writeln('</scr' + 'ipt>');
}

function noFlashFound() {

		document.write('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E8E8E8" class="flash_detect">'
  + '  <tr>'
  + '    <td align="center" valign="middle"><br>Você precisa do Flash 8  para ver este conteúdo.<br>You need Flash Player 8 to see this content.<br><br><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">Intale Agora / Install Now</a><br><br></td>'
  + '  </tr>'
  + '</table>');
}


//////////////////////////////////////////////////////////////////////////
//
function comboSelect( obj ) { // , newWindow
  if ( obj.selectedIndex != 0 ) {
    if ( obj.value.substr(0,4) == "http" ) {
      window.open(obj.value,"_blank")
      obj.selectedIndex= 0;
    } else {
      window.location= obj.value;
    }
  }
}

function Flash(nomeSWF, largura, altura, title,InitVars, flagTitle) {

  var rootpath= root; // "root" is defined in each page

  if(InitVars==undefined){
		InitVars=""
	}

	if(flagTitle==undefined || flagTitle==false){
		title=""
	}

	// Inserido em 22/10/08
	InitVars=InitVars.replace("%","%25");
	InitVars=InitVars.replace("+","%2b");
	//
	var varname= 'urlvars=';
	var getUrl= '';
	var srcstr= location.search.substr(1);
	var varpos= srcstr.toLowerCase().indexOf(varname);
	// getUrl = getUrl.split('urlvars=')[1];
	// document.write( srcstr + "<br>" );
	// document.write( varpos + "<br>" );
	if (varpos > -1) {
		getUrl= srcstr.substr(varpos + varname.length);
	  	// document.write( getUrl + "<br>" );
		if(getUrl!=undefined){
			getUrl = getUrl.split('&')[0];
		}
		if(getUrl!=undefined){
			InitVars += "|"+ unescape(getUrl);
		}
	}

  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" title="'+title+'" width="' + largura + '" height="' + altura + '"/>\n');
	document.write('<param name="movie" value="' + root + 'flash/' + nomeSWF + '.swf"/>\n');
	document.write('<param name="quality" value="high" />\n');
	//document.write('<param name="menu" value="false" />\n');
	document.write('<param name="FlashVars" value="InitVars=' + InitVars+ '" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<embed src="' + root + 'flash/' + nomeSWF + '.swf" wmode="transparent" menu="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ largura + '" height="' + altura + '" wmode="transparent" FlashVars="InitVars=' + InitVars + '"></embed>\n');
  document.write('</object>\n');
}

function trimStr(s) {
   return '' + s.replace(/^\s*/, "").replace(/\s*$/, "") + '';
}

function addToFavorites()
{
	var browsName = navigator.appName;
	if (browsName == "Microsoft Internet Explorer") {
		if (document.all)
			window.external.addFavorite("http://www.votorantim-cimentos.com.br/","Votorantim Cimentos")
	}else if (browsName == "Netscape") {
		alert ("\nPara adicionar Votorantim Cimentos no Favoritos aperte CTRL+D");
	}
}

function openAmb() {
	obj = document.getElementById("AmbPosition");
	obj.style.height = "365px";
	if (navigator.appName == "Microsoft Internet Explorer") {
		versao_arr = navigator.appVersion.split(";");

		if (versao_arr[1]== " MSIE 6.0") {
			document.getElementsByTagName("select")[1].style.visibility = "hidden";
		}
	}
}

function closeAmb() {
	obj = document.getElementById("AmbPosition");
	obj.style.height = "110px";
	if (navigator.appName == "Microsoft Internet Explorer") {
		versao_arr = navigator.appVersion.split(";");
		if (versao_arr[1]== " MSIE 6.0") {
			document.getElementsByTagName("select")[1].style.visibility = "visible";
		}
	}
}

