<script>
function formatadata(obj, tecla)
{
   if (tecla.keyCode == 8)
      return true; 
   var continuar = false;	  
   if ((tecla.keyCode >= 48) && (tecla.keyCode <= 57)) { continuar = true; }
   if ((tecla.keyCode >= 96) && (tecla.keyCode <= 105)) { continuar = true; }
   if ((tecla.keyCode == 46) || (tecla.keyCode == 8)) { continuar = true; }
   if (continuar == false)
     return false;

   vlr = obj.value;
   vlr2 = "";
   vlr = vlr.replace("/","");
   vlr = vlr.replace("/","");
   vlr2 = vlr2 + vlr.substr(0,2);
   if (vlr.length >= 2) 
     vlr2 = vlr2 + "/";
   vlr2 = vlr2 + vlr.substr(2,2);
   if (vlr.length >= 4) 
     vlr2 = vlr2 +"/";
   vlr2 = vlr2 + vlr.substr(4,4);
   obj.value = vlr2;
   return true;
}
function sonumero(mobjeto, mevento)
{
  if ((mevento.keyCode >= 48) && (mevento.keyCode <= 57)) { return true; }
  //if ((mevento.keyCode >= 96) && (mevento.keyCode <= 105)) { return true; }
  if ((mevento.keyCode == 46) || (mevento.keyCode == 8)) { return true; }
  return false;
}  
function AbreJanela(endereco)  
{
   popup = window.open(endereco,"Detalhes","toolbar=0,scrollbars=0,location=0,directories=0,copyhistory=0,status=0,menubar=0,resizable=0,width=400,height=280,z-lock,screenX=90,screenY=100, Left=120, Top=50"); 
}
function AbreNoticia(endereco)  
{
   popup = window.open(endereco,"Detalhes","toolbar=0,scrollbars=0,location=0,directories=0,copyhistory=0,status=0,menubar=0,resizable=0,width=500,height=375,z-lock,screenX=90,screenY=100, Left=120, Top=40"); 
}
function abretempo()
{
	ccid = frmtempo.cidade.value;
    if (ccid > ' ')
    {  
      curl = "http://www4.climatempo.com.br/climatempo/cidade.php?uf=rs&cidade="+ccid;
      ftempo = open(curl,"meteorologia","toolbar=0,scrollbars=0,location=0,directories=0,copyhistory=0,status=0,menubar=0,resizable=0,width=198,height=465,z-lock, Left=250, Top=50"); 
      ftempo.focus();
    }
}
function amplia_produto(endereco)  
{
   popup = window.open(endereco,"Detalhes","toolbar=0,scrollbars=no,location=0,directories=0,copyhistory=0,status=no,menubar=0,resizable=0,width=700,height=663,z-lock,Left=0, Top=0"); 
}
function abre_print(endereco)  
{
   popup = window.open(endereco,"Detalhes","toolbar=0,scrollbars=yes,location=0,directories=0,copyhistory=0,status=no,menubar=0,resizable=0,width=700,height=400,z-lock,Left=50, Top=50"); 
}
function imprime_noticia(endereco)  
{
   popup = window.open(endereco,"Detalhes","toolbar=0,scrollbars=yes,location=0,directories=0,copyhistory=0,status=no,menubar=0,resizable=0,width=517,height=436,z-lock,Left=50, Top=50"); 
}

</script>
