// para o menu temas

	function EscondeDiv(luiza) {

	  if(luiza.length < 1)  return; 

	  document.getElementById(luiza).style.display = "none";

	}

	

	function MostraDiv(luiza) {

	  if(luiza.length < 1)  return; 

	  document.getElementById(luiza).style.display = "block";

	 }

	function EscondeOutras(luiza){

	var divis = []

	divis[0] = 'temas'
	divis[1] = 'imprensa'

	i = 0;

	quantas=divis.length;

	while (i<quantas){

	 esta = divis[i];

	 if (esta != luiza){EscondeDiv(esta)}

	 i++; 

	  }

	}





// para o menu temas

		function showElement(layer){

			var myLayer = document.getElementById(layer);

			if(myLayer.style.display=="none"){

			  myLayer.style.display="block";

			  myLayer.backgroundPosition="top";

			} else {

			  myLayer.style.display="none";

			}

		}



// para qualquer onmouseover

	function troca(nome,nova){

	document[nome].src=nova;

	}



// para cadastro de email

	function valida_email()

	{

	  var emailRE = /^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/;

	  if( document.theForm.EMAIL.value.match( emailRE ) )

	  {

	     document.theForm.submit();

	  }

	  else

	  {

	     alert( "E-mail invalido" );

	  }

	}  



// para layers escondidas

	function mostraLayer( whichLayer )

	{

	  var elem, vis;

	  if( document.getElementById ) // this is the way the standards work

	    elem = document.getElementById( whichLayer );

	  else if( document.all ) // this is the way old msie versions work

	      elem = document.all[whichLayer];

	  else if( document.layers ) // this is the way nn4 works

	    elem = document.layers[whichLayer];

	  vis = elem.style;

	  // if the style.display value is blank we try to figure it out here

	  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)

	    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';

	  vis.display = (vis.display==''||vis.display=='block')?'none':'block';

	}



// para o compartilhe

	function mostra_esconde(prima, segun, op){

	var elem, sumi,vis,invis;

	if( document.getElementById ){

			elem = document.getElementById(prima);

			sumi = document.getElementById(segun);

			} 

			else if( document.all ){

			elem = document.all[prima];

			sumi = document.all[segun];

			}

			else if( document.layers ) {

				elem = document.layers[prima];

				sumi= document.layers[segun];			

				}

	vis = elem.style;

	invis = sumi.style;

	if(op==1){

		if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)

		  vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';

		vis.display = (vis.display==''||vis.display=='block')?'none':'block';

		if(invis.display==''&&sumi.offsetWidth!=undefined&&sumi.offsetHeight!=undefined)

		  invis.display = (sumi.offsetWidth!=0&&sumi.offsetHeight!=0)?'block':'none';

		invis.display = (invis.display==''||vis.display=='block')?'none':'block';

		}

	else{

		vis.display='none';

		invis.display='none';

		}

	}





// para gravar, ler e deletar cookies - expires define o numero de dias de duração do cookie



	function getCookie(NameOfCookie)

	   { if (document.cookie.length > 0)

	       { begin = document.cookie.indexOf(NameOfCookie+"=");

	         if (begin != -1)

	           { begin += NameOfCookie.length+1;

	             end = document.cookie.indexOf(";", begin);

	             if (end == -1) end = document.cookie.length;

	             return unescape(document.cookie.substring(begin, end)); 

                   }

	       }

	     return null;

	   }









	function setCookie( name, value, expires, path) 

	  { var today = new Date();

	    today.setTime( today.getTime() );

	    if ( expires ) 

	       { expires = expires * 1000 * 60 * 60 * 24 ;

	       }

            var expires_date = new Date( today.getTime() + (expires) );

            document.cookie = name+"="+escape( value ) +

            ( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()

            ( ( path ) ? ";path=" + path : "" ) ;

           }





// para tamanho de letra



	var fs = new Array('14px','15px','16px','17px','18px','19px','20px','21px','22px','23px','24px','25px');	

	var contador = 0;



	function novoTamanho(x){

		if(x == 0){

			if(contador < fs.length - 1){

				contador++;

				document.getElementById("miolo").style.fontSize = fs[contador];

				document.getElementById("miolo").style.lineHeight = fs[contador];

			}

		}

	if(x == 1){

		if(contador > 0){ 

			contador--;

			document.getElementById("miolo").style.fontSize = fs[contador];

			document.getElementById("miolo").style.lineHeight = fs[contador];

			}

		}



	setCookie("tamletracookie", contador, "365", "/")



	}



        function meuTamanho(){

		mtam=getcookie("tamletracookie");

		document.getElementById("miolo").style.fontSize = fs[mTam];

		document.getElementById("miolo").style.lineHeight = fs[mTam];

	

	}  



	

	


