
//begin globals

var lastlayerid = 'LTreinar';
	briefintro = document.getElementById('brief_intro');
	lnulo = document.getElementById('LNull');
	tagfechar = '<span id="fechar" class="fechar">fechar</span>';

//end globals

function todefault(dst){ document.getElementById(dst).innerHTML = tagfechar + document.getElementById(lastlayerid).innerHTML; }

function changedest (src,hgt) {

	lastlayerid = src;		
	todefault('brief_intro'); 
	document.getElementById('brief_intro').style.minHeight= hgt;
	//document.getElementById('brief_intro').style.hasLayout;
	if(hgt!='30px'){document.getElementById('fechar').style.visibility="visible";}else{document.getElementById('fechar').style.visibility="hidden";};
	//document.getElementById('brief_intro').style.height="1%";
	//scrollBot()
	
	}
	
function fechar() {
  bogu = document.getElementById('basecor').getElementsByTagName('IMG')[0];
   
  bogu.onclick=function(){
		if(document.getElementById('brief_intro').offsetHeight!=30 )
		{var number= document.body.offsetHeight-110; changedest('LNull','30px');  window.scrollTo(0,number)} 
		else{ var number= document.body.offsetHeight-240; changedest('LTreinar','150px'); window.scrollTo(0,number) };
		};
		
	  bogu.onmouseover= function(){
		if(document.getElementById('brief_intro').offsetHeight==30){
			document.getElementById('menubottom2').getElementsByTagName('A')[0].className="spanblock"
			};
		//else{  
		document.getElementById('fechar').className="fecharhover";
		//}
		};
		
	  bogu.onmouseout=function (){
		document.getElementById('menubottom2').getElementsByTagName('A')[0].className="none";
		document.getElementById('fechar').className="fechar";
		};


	}


function marcaopt(){
	todalista = document.getElementById('menubottom').getElementsByTagName('li');
	todalista2 = document.getElementById('menubottom2').getElementsByTagName('li');
	for(k=0;k<todalista.length;k++)
		{todalista[k].onclick= function(){ 
			for(i=0;i<todalista.length;i++) todalista[i].className="none"; this.className="select";
			for(w=0;w<todalista2.length;w++) todalista2[w].className="none";

			};
		}
		
	for(u=0;u<todalista2.length;u++)
		{todalista2[u].onclick= function(){ 
			for(i=0;i<todalista2.length;i++) todalista2[i].className="none"; this.className="select";
			for(w=0;w<todalista.length;w++) todalista[w].className="none";
			};
		}
	}

function lbottom(){
	var linkbottom = document.getElementById('menubottom').getElementsByTagName('li');
	var linkbottom2 = document.getElementById('menubottom2').getElementsByTagName('li');
	var linkbottom3 = document.getElementById('rodape').getElementsByTagName('a');
		for(j=0;j<linkbottom.length;j++)
		{linkbottom[j].getElementsByTagName('a')[0].setAttribute('href',"javascript: scrollBot()");
		}
		for(l=0;l<linkbottom3.length;l++)
		{linkbottom3[l].setAttribute('href',"javascript: scrollBot()");
		}
		for(k=0;k<linkbottom2.length;k++)
		{linkbottom2[k].getElementsByTagName('a')[0].setAttribute('href','javascript: scrollBot()');	}
		//document.getElementById('basedeco1').setAttribute('href','#glossario');
		changedest ('LNull','30px');
		//briefintro.innerHTML = lnulo.innerHTML;
		marcaopt();
		fechar();
		
		 if(document.getElementById("faleinterno")) {
			var linkbottom2 = document.getElementById("menubottom2").getElementsByTagName('LI');
			var numerofil = linkbottom2.length-1;
			linkbottom2[numerofil].innerHTML = '<a onclick="scrollTo(0,0)" href="javascript: void(0);">Fale Conosco</a>';
			}
	}
	

function scrollBot(){
	hdoc = document.body.offsetHeight;
	var hbot = 240;
	var altu = hdoc-hbot;
	//alert(hdoc + "-" + hbot + "=" + altu);
	window.scrollTo(0,altu);
	}
	