function addToFavorites() {
	if (document.all) {
		window.external.addFavorite("http://www.votorantim.com.br/","Votorantim");
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function limpa_campo(obj) {
	obj.value = "";
}
function busca_campo(obj) {
	if (obj.value=="") obj.value = "BUSCA";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function abre_ambientacao() {
	amb_obj = document.getElementById("flash_amb_full");
	amb_obj.style.overflow = "visible"
	amb_obj.style.position = "absolute"
	amb_bg = document.getElementById("amb_background");
	amb_bg.style.display = "block"
	amb_select = document.getElementsByTagName("select");
	for(i=1;i<amb_select.length;i++) {
		amb_select[i].style.display = "none"
	}
}
function fecha_ambientacao() {
	amb_obj = document.getElementById("flash_amb_full");
	amb_obj.style.overflow = "hidden"
	amb_obj.style.position = "relative"
	amb_bg = document.getElementById("amb_background");
	amb_bg.style.display = "none"
	amb_select = document.getElementsByTagName("select");
	for(i=1;i<amb_select.length;i++) {
		amb_select[i].style.display = "block"
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function menutopo_opensub(obj) {
	conj = document.getElementById("conj1");
	menu_quant = conj.innerHTML.toLowerCase().split('</td>').length;
	for(i=1;i<menu_quant;i++) {
		submenu = document.getElementById("submenu"+i);
		if (submenu.innerHTML != "") {
			obj_inner_basic = submenu.innerHTML.toLowerCase().split('<div');
			submenu.innerHTML = obj_inner_basic[0];
			document.getElementById("submenu"+i+"_conj").style.display = "none";
		}
	}
	submenu = document.getElementById("sub"+obj.id);
	if (submenu.innerHTML != "") {
		obj_inner_basic = submenu.innerHTML.toLowerCase().split('<div');
		submenu.innerHTML = obj_inner_basic[0] + "<div class='aba'></div><div class='aba_hide_seta'><img src='' width='1' height='1' /></div>";
		document.getElementById("sub"+obj.id+"_conj").style.display = "block";
	}
}
function menutopo_fechasub() {
	submenu_nome = objname.split("_");
	submenu = document.getElementById(submenu_nome[0]);
	if (submenu.innerHTML != "") {
		obj_inner_basic = submenu.innerHTML.toLowerCase().split('<div');
		submenu.innerHTML = obj_inner_basic[0];
		document.getElementById(submenu.id+"_conj").style.display = "none";
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
var temposub = ""
function menutopo_timer_fechasub(obj) {
	objname = obj
	temposub = setTimeout(menutopo_fechasub,500);
}
function menutopo_cancela_fechasub(obj) {
	clearTimeout(temposub);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function menutopo_opensub2(objid) {
	document.getElementById(objid).style.display = "block";
}
function menutopo_fechasub2() {
	document.getElementById(objname2).style.display = "none";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
var temposub2 = ""
function menutopo_timer_fechasub2(obj) {
	objname2 = obj
	temposub2 = setTimeout(menutopo_fechasub2,500);
}
function menutopo_cancela_fechasub2() {
	clearTimeout(temposub2);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
tamanho_atual = 1
function mudaTamanho(valor) { // 12,13,16
	h1 = document.getElementsByTagName('h1');
	h2 = document.getElementsByTagName('h2');
	p = document.getElementsByTagName('p');
	if (valor=='menos') {
		if (tamanho_atual > 1) tamanho_atual -= 1
	}
	if (valor=='mais') {
		if (tamanho_atual < 4) tamanho_atual += 1
	}
	if (tamanho_atual==1) {
		for(i=0;i<h1.length;i++) { h1[i].style.fontSize = "16px" }
		for(i=0;i<h2.length;i++) { h2[i].style.fontSize = "14px" }
		for(i=0;i<p.length;i++) { p[i].style.fontSize = "12px" }
	}
	if (tamanho_atual==2) {
		for(i=0;i<h1.length;i++) { h1[i].style.fontSize = "18px" }
		for(i=0;i<h2.length;i++) { h2[i].style.fontSize = "16px" }
		for(i=0;i<p.length;i++) { p[i].style.fontSize = "14px" }
	}
	if (tamanho_atual==3) {
		for(i=0;i<h1.length;i++) { h1[i].style.fontSize = "20px" }
		for(i=0;i<h2.length;i++) { h2[i].style.fontSize = "18px" }
		for(i=0;i<p.length;i++) { p[i].style.fontSize = "16px" }
	}
	if (tamanho_atual==4) {
		for(i=0;i<h1.length;i++) { h1[i].style.fontSize = "23px" }
		for(i=0;i<h2.length;i++) { h2[i].style.fontSize = "21px" }
		for(i=0;i<p.length;i++) { p[i].style.fontSize = "19px" }
	}
}





/* =============Ajax Loading============ */

function _AddEvent(strEvent, object, funcref) {
    if(window.addEventListener){ // Mozilla, Netscape, Firefox
	    object.addEventListener(strEvent, funcref , false);
	    object.addEventListener(strEvent, funcref, false);
    } else { // IE
	    object.attachEvent('on' + strEvent, funcref);
	    object.attachEvent('on' + strEvent,  funcref, false);
	    //window.attachEvent('document.onmousewheel',  null, false);
    	
    }
}

function rePosLoading() {
    if(navigator.appName.indexOf('Internet Explorer')>0) {
        //alert(document.all.ajaxLContainer.style.pixelTop)
        if(document.all.ajaxLContainer) document.all.ajaxLContainer.style.pixelTop = document.documentElement.scrollTop;
        //alert(document.all.ajaxLContainer.style.pixelTop)
    } else {
        if(document.all.ajaxLContainer) document.all.ajaxLContainer.style.top = (document.documentElement.scrollTop) + "px";
    }
}


_AddEvent("scroll", window, function() { rePosLoading() });



function closeSummary(sender) {
    sender.parentElement.style.display = "none";
}

function AbreSub(obj) {
    obj.onclick();
}

function simulateMouse(element, eventName) {
    if(window.addEventListener){ // Mozilla, Netscape, Firefox    
        var oEvent = document.createEvent("MouseEvents");
        oEvent.initMouseEvent(eventName, true, true, document.defaultView, 
        1, 0, 0, 0, 0, false, false, false, false, 0, document.getElementById(element));
        document.getElementById(element).dispatchEvent(oEvent);
    }else{
        document.getElementById(element).click();
    }
}

