// JavaScript Document
//<!--

function troca(c) {
campo=c;
setTimeout("exec_troca()",1);
}

function exec_troca(c) {
campo.value=virgula(campo.value);
}

function virgula(texto) {
texto=texto.replace(",",".");
return texto;
}


 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17718469-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

function EvitaLetra(e) {

  if (e.keyCode) tecla = e.keyCode;  	
  else if (e.which) tecla = e.which; // Netscape 4.?
  else if (e.charCode) tecla = e.charCode; // Mozilla

  if (tecla != 8 && tecla != 9 && (tecla < 48 || tecla > 57))
   return false;
   
}


function trava_caracter(){
	if(event.keyCode < 48 || event.keyCode > 57){
		event.keyCode = 0;
	}
}
function trava_aspas(){
	if(event.keyCode == 34 || event.keyCode == 39){
		event.keyCode = 0;
	}
}
function descricao(i){
	if(document.getElementById(i).style.display=='none'){
		document.getElementById(i).style.display='';
	}else{
		document.getElementById(i).style.display='none';
	}
}

function over(src, color){
	src.bgColor = color;
}

function relogio() {
  var horas, minutos, segundos;
  var intMinutos, intSegundos;
  var agora;
  agora = new Date();
  horas = agora.getHours();
  intMinutos = agora.getMinutes();
  intSegundos = agora.getSeconds();

  if (intMinutos < 10) {
     minutos = "0"+intMinutos;
  } else {
     minutos = intMinutos;
  }
  if (intSegundos < 10) {
     segundos = "0"+intSegundos;
  } else {
     segundos = intSegundos;
  } 
  timeString = horas + ":" + minutos + ":" + segundos;
  //Horario.innerHTML = timeString;
  window.setTimeout("relogio();", 100);
}
window.onload = relogio;

function abrir(url,rolagem,lar,alt){
	LeftPosition = (screen.width) ? (screen.width-lar)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-alt)/2 : 0;
window.open(url,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,top='+TopPosition+',left='+LeftPosition+',scrollbars='+rolagem+',resizable=no,menubar=no,width='+lar+',height='+alt);	
  }
 
 function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
   
function confirma_exclusao(){
	Sexy.confirm('DESEJA EXCLUIR O(s) REGISTRO(s) SELECIONADO(s) ?!', {onComplete: function(returnvalue) { if(returnvalue) { document.excluir.submit(); } else { } } });
}

function confirma_autenticacao(){
	Sexy.confirm('DESEJA AUTENTICAR O(s) REGISTRO(s) SELECIONADO(s) ?!', {onComplete: function(returnvalue) { if(returnvalue) { document.autenticar.submit(); } else { } } });
}

function confirma_desabilita(){
	Sexy.confirm('DESEJA DESABILITAR O(s) REGISTRO(s) SELECIONADO(s) ?!', {onComplete: function(returnvalue) { if(returnvalue) { document.desabilitar.submit(); } else { } } });
}

function confirma_habilita(){
	Sexy.confirm('DESEJA HABILITAR O(s) REGISTRO(s) SELECIONADO(s) ?!', {onComplete: function(returnvalue) { if(returnvalue) { document.habilitar.submit(); } else { } } });
}



function Show(obj){
	if (parseInt(navigator.appVersion) >= 5 ||
	    navigator.appVersion.indexOf["MSIE 5"] != -1){
		if (obj.style.display=="none")
			obj.style.display="";
		else
			obj.style.display="none";
	}
}
// -->

