//aumentar texto
  function sizeFont2 (elem, acao)
  {
      // tamanho inicial da fonte (em px)
      var tamInic = 10;
      // Tamanho mínimo da fonte (em px)
      var tamMin = 6;
      // Tamanho máximo da fonte (em px)
      var tamMax = 22;
      if (document.getElementById(elem).style.fontSize == "") 
        var tamFonte = tamInic;
      else
        var tamFonte = parseInt(document.getElementById(elem).style.fontSize);
      switch (acao)
      {
        case '+':
          if (tamFonte < tamMax)
            document.getElementById(elem).style.fontSize = (tamFonte + 2) + "px";
        break;
        case '-':
          if (tamFonte > tamMin)
            document.getElementById(elem).style.fontSize = (tamFonte - 2) + "px";
        break;
      }
  }


//scroll abrir janela radio
function abrir(url) {
  window.open(url,'radio','scrollbars=no,status=no,location=no,toolbar=no,menubar=no,width=372,height=164,top=1,left=1');
}

//scroll abrir janela
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',noresizable'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}

// Telefone formato
function TelefoneFormat(Campo, e) {
	var key = '';
	var len = 0;
	var strCheck = '0123456789';
	var aux = '';
	var whichCode = (window.Event) ? e.which : e.keyCode;
	
	if (whichCode == 13 || whichCode == 8 || whichCode == 0)
	{
		return true;  // Enter backspace ou FN qualquer um que não seja alfa numerico
	}
	key = String.fromCharCode(whichCode);
	if (strCheck.indexOf(key) == -1){
		return false;  //NÃO E VALIDO
	}
	
	aux =  Telefone_Remove_Format(Campo.value);
	
	len = aux.length;
	if(len>=10)
	{
		return false;	//impede de digitar um telefone maior que 10
	}
	aux += key;
	
	Campo.value = Telefone_Mont_Format(aux);
	return false;
}

function  Telefone_Mont_Format(Telefone)
{
	var aux = len = '';
	
	len = Telefone.length;
	if(len<=9)
	{
		tmp = 5;
	}
	else
	{
		tmp = 6;
	}
	
	aux = '';
	for(i = 0; i < len; i++)
	{
		if(i==0)
		{
			aux = '(';
		}
		aux += Telefone.charAt(i);
		if(i+1==2)
		{
			aux += ')';
		}
		
		if(i+1==tmp)
		{
			aux += '-';
		}
	}
	return aux ;
}

function  Telefone_Remove_Format(Telefone)
{
	var strCheck = '0123456789';
	var len = i = aux = '';
	len = Telefone.length;
	for(i = 0; i < len; i++)
	{
		if (strCheck.indexOf(Telefone.charAt(i))!=-1)
		{
			aux += Telefone.charAt(i);
		}
	}
	return aux;
}


// Checar se o formulário está completo CONTATO
function checa_formulario_contato(){
if (form1.nome.value == ""){
alert("É necessário informar seu NOME");
form1.nome.focus();
return (false);
}
if (form1.telefone.value == ""){
alert("É necessário informar seu TELEFONE para contato");
form1.telefone.focus();
return (false);
}
if (form1.email.value == ""){
alert("É necessário informar seu E-MAIL para contato");
form1.email.focus();
return (false);
}
if (form1.obs.value == ""){
alert("É necessário adicionar sua MENSAGEM");
form1.obs.focus();
return (false);
}
return (true);
}

// Checar se o formulário está completo boletim
function checa_formulario_boletim(){
if (form1.nome.value == ""){
alert("É necessário informar seu NOME");
form1.nome.focus();
return (false);
}
if (form1.email.value == ""){
alert("É necessário informar seu E-mail");
form1.email.focus();
return (false);
}
return (true);
}

// Checar se o formulário está completo a_contato
function checa_formulario_a_contato(){
if (a_contato.nome.value == ""){
alert("É necessário informar seu Nome");
a_contato.nome.focus();
return (false);
}
if (a_contato.telefone.value == ""){
alert("É necessário informar seu Telefone para contato");
a_contato.telefone.focus();
return (false);
}
if (a_contato.obs.value == ""){
alert("É necessário digitar uma Mensagem");
a_contato.obs.focus();
return (false);
}
return (true);
}

// Checar se o formulário está completo atividades
function checa_formulario_atividades(){
if (atv.nome.value == ""){
alert("É necessário informar seu Nome Completo");
atv.nome.focus();
return (false);
}
if (atv.email.value == ""){
alert("É necessário informar seu E-MAIL para contato");
atv.email.focus();
return (false);
}
if (atv.telefone.value == ""){
alert("É necessário informar seu TELEFONE para contato");
atv.telefone.focus();
return (false);
}
return (true);
}
