  function conta_digitos() { 
   	  document.getElementById('contador').innerHTML = document.getElementById('comentario').value.length+'/'+'600';
      if (document.getElementById('comentario').value.length > 599)
	  {
	  	document.getElementById('comentario').value = document.getElementById('comentario').value.substring(0,599);
	  	return false;
	  }
   } 
   
   function conta_digitos_contato() { 
   	  document.getElementById('contador').innerHTML = document.getElementById('mensagem').value.length+'/'+'1000';
      if (document.getElementById('mensagem').value.length > 999)
	  {
	  	document.getElementById('mensagem').value = document.getElementById('mensagem').value.substring(0,999);
	  	return false;
	  }
   } 
	   
function addFav(){
    var url      = "http://www.fcgt.com.br";
    var title    = "www.FCGT.com.br, o maior portal informativo do Norte de Minas!";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}

	   
	   
		  function enquete_confirm(radio){      
	   	    var continua=false;
	        for (var i=0; i<radio.length; i++)
			{
				if (radio[i].checked)
				{
					continua=true;
				}
			}
			if (continua==false)
			{
				alert("Selecione uma opcao");
				return (false);
			}				
			else
			{
				return (true);
			}
	    }	

	   
	   function mascaraData(campo)
		{             
		 	var data = campo.value;              
			if (data.length == 2){                  
				data = data + '-';                  
				campo.value = data;      
				return true;              
			}              
			if (data.length == 5){                  
				data = data + '-';                  
					campo.value = data;                  
					return true;              
			}     
		}
				
		function publicidade_abre(div)
		{
			document.getElementById(div).style.display='block';
		}
		
		function publicidade_fecha(div)
		{
			document.getElementById(div).style.display='none';
			
		}	
				
		function NumeroInt(e, objeto){
			campo = eval (objeto);
			var tecla = (window.event)?event.keyCode:e.which;	
		    if(tecla> 47 && tecla < 58) {
			return true;
			}
			else
			{
			if (tecla != 8) return false;
		    else return true;
		    }
		}	

	    function news_confirm(form){         
			if ((document.getElementById('input_site').value.indexOf('@')==-1)||(document.getElementById('input_site').value.indexOf('.')==-1))
			{
				alert("Email invalido.");
				return (false);
			}
			else
			{
				alert("Clique em OK para confirmar o seu cadastro em nosso banco de dados. Em breve novidades!");
				return (true);
			}
	    }	
		

	     function email_confirm(form,cont){         
			var continua;
			if (document.getElementById('nome').value=="")
			{
				alert('Voce precisa preencher pelo menos o nome.');
				return (false);
			}
			else
			{
				for (i=0; i<cont.value; i++)
			{
				if (document.getElementById(i).checked==true)
				{
					continua=true;
				}
			}
			if (continua==true)
			{
				return (true);
			} 
			else
			{
				alert("Selecione pelo menos um destinatário para a mensagem");
				return (false);
			}
			}
			
	    }
		
		function checa_matriz()
		{
			document.getElementById('checkmatriz').checked=true;
		}

	function popitup(url) {

	newwindow=window.open(url,'name','height=300,width=300');

	if (window.focus) {newwindow.focus()}

		return false;

	}
	
	function popituppromocoes(url) {

	newwindow=window.open(url,'name','height=600,width=400');

	if (window.focus) {newwindow.focus()}

		return false;

	}
	
	function setFocus(campo)
		{
			document.getElementById(campo).focus();
			document.getElementById(campo).select();
		}
		
		function Numero(e, objeto){
			campo = eval (objeto);
			var tecla = (window.event)?event.keyCode:e.which;	
		    if(tecla> 47 && tecla < 58) {
			return true;
			}
			else
			{
			if (tecla != 8) return false;
		    else return true;
		    }
		}	
