  function mascaraDataCalend(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 desativa_botao(nome)
{
	document.getElementById(nome).disabled=1;
	document.form.submit();
}
	   
	   function maskIt(w,e,m,r,a){
        
			// Cancela se o evento for Backspace
			if (!e) var e = window.event
			if (e.keyCode) code = e.keyCode;
			else if (e.which) code = e.which;
			
			// Variáveis da função
			var txt  = (!r) ? w.value.replace(/[^\d]+/gi,'') : w.value.replace(/[^\d]+/gi,'').reverse();
			var mask = (!r) ? m : m.reverse();
			var pre  = (a ) ? a.pre : "";
			var pos  = (a ) ? a.pos : "";
			var ret  = "";
	
			if(code == 9 || code == 8 || txt.length == mask.replace(/[^#]+/g,'').length) return false;
	
			// Loop na máscara para aplicar os caracteres
			for(var x=0,y=0, z=mask.length;x<z && y<txt.length;){
					if(mask.charAt(x)!='#'){
							ret += mask.charAt(x); x++;
					} else{
							ret += txt.charAt(y); y++; x++;
					}
			}
			
			// Retorno da função
			ret = (!r) ? ret : ret.reverse()        
			w.value = pre+ret+pos;
		}
	   
	   	function copiaCampo(valor,campo_receber)
		{             
		 	document.getElementById(campo_receber).value = valor;
		}

	   
	   	function delete_confirm()
		{
			if (!confirm("Tem certeza que deseja apagar esse item?"))
			{
				return (false);
			}
		}	
		
		 function confirmar_saida_processo()
		{
			if (!confirm("Tem certeza que deseja sair deste processo?"))
			{
				return (false);
			}
		}	
		
		
		 function finalizar_processo()
		{
			if (!confirm("Clique em OK para finalizar a sua participacao neste processo."))
			{
				return (false);
			}
		}	
		
	   
	   	function copia_link(campo)
		{
			document.getElementById(campo).focus();
			document.getElementById(campo).select();
			document.execCommand("Copy");
		}
	   
	
	
	 function validalogin(form){   
	 		if (document.getElementById('login').value=='')
			{
				alert('Login invalido');
				return false;
			}
			else
			{
				return true;
			}	
	} 
	   
	      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 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 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 comentar_confirm()
   {
		if ((!document.getElementById('nome_comentario').value)||(document.getElementById('comentario').value.length==0))
		{
			alert('Nome e comentario sao obrigatorios!');
			return false;
		}	
		else
		{
			alert('Agradecemos a sua participacao! Seu comentario sera analisado e podera ser publicado! Aguarde!');
			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 NumeroInt(e, objeto){
			campo = eval (objeto);
			var tecla = (window.event)?event.keyCode:e.which;	
			if (tecla==0)
			{
				return true;
			}
		    else if(tecla> 47 && tecla < 58) {
			return true;
			}
			else
			{
			if (tecla != 8) return false;
		    else return true;
		    }
		}	
		
		function NumeroIntcomEnter(e, objeto){
			campo = eval (objeto);
			var tecla = (window.event)?event.keyCode:e.which;	
			if (tecla==0)
			{
				return true;
			}
		    else if(tecla> 47 && tecla < 58) {
			return true;
			}
			else if(tecla==13) {
			return true;
			}
			else
			{
			if (tecla != 8) return false;
		    else return true;
		    }
		}	

	    function news_confirm(form){         
			if ((document.getElementById('email').value.indexOf('@')==-1)||(document.getElementById('email').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 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;
		    }
		}	
		
		function quant_confirm(form)
		{
			if (form.quant.value=="")
			{
				alert('Por favor informe a quantidade.');
				return false;
			}
			else
			{
				return true;
			}
		}
		
		function email_indicar($form)
		{
			if (document.getElementById('email_indica').value.indexOf('@')==-1)
			{
				alert('Preencha um email valido.');
				return (false)
			}
			else
			{
				alert('Site recomendado! Obrigado por colaborar com a gente!');
				return (true);
			}
		}
		
		function email_arroba_confirm($form)
		{
			if (document.getElementById('email').value.indexOf('@')==-1)
			{
				alert('Preencha um email valido.');
				return (false)
			}
		}
		
		function tr_over(id)
		{
			document.getElementById(id+'tr').style.backgroundColor="#d2e4fc";
		}
		
		function tr_out(id)
		{
			document.getElementById(id+'tr').style.backgroundColor="#F8F8F8";
		}
		
		
