<!--
window.status='www.FMBB.com.br';

// pop up
function pop() {
  window.open("http://www.terra.com.br/ads/tag_pop_220x230_americana.htm","Publicidade","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=230,height=220,left=400,top=0")
}

//checkm8
var cm8cat="br_compras_internas";

// cookie
function TpceSetCookie () {
  if (TpceGetCookie('popupcompras') != '1') {
    pop();
    document.cookie = 'popupcompras=1'
  }
}

function TpceGetCookie (name) {
  //Devolve o valor de um cookie
  var x1 = TpceIsCookie(name);
  if (x1 == null) return null;
  var x2 = document.cookie.indexOf (";", x1);
  if (x2 == -1) x2 = document.cookie.length;
  var ret = document.cookie.substring(x1, x2);
  return ret;
}

function TpceIsCookie (name) {
  //Indica se existe um cookie com esse nome
  var arg = ' popupcompras=';
  var ret = TpceFindStr(' ' + document.cookie, arg);
  return (ret == null) ? null : ret + arg.length - 1;
}

function TpceFindStr (src, pat) {
  //Procura string
  var alen = pat.length, chr1 = pat.substring(0, 1);
  var clen = src.length, i = 0;
  while (i < clen) {
    var j = i + alen;
    if (src.substring(i, j) == pat) return i;
    i = src.indexOf(chr1, i + 1);
    if (i <= 0) break;
  }
  return null;
}

//link na td
function mclk(src) {
  if(event.srcElement.tagName=='TD') {
    src.children.tags('A')[0].click();
  }
}

//cores de fundo
function mOut(src,cor) {
        if (!src.contains(event.toElement)) {
         src.style.cursor = 'default';
         src.bgColor = cor;
        }
}

function mOvr(src,cor) {
 if (!src.contains(event.fromElement)) {
         src.style.cursor = 'hand';
         src.bgColor = cor;
	     }
}

 //função para mostrar/ocultar o menu contato 
function menuContato(){
Nav=(navigator.appName=="Netscape")?1:2;
  if(Nav==1){
    with(document.menu){
      if(visibility=="hide"){
      visibility='show';
      }else{
      visibility='hide';
      }
    }
  }
  if(Nav==2){
    with(document.all.menu.style){
      if(visibility=="hidden"){
      visibility='visible';
      }else{
      visibility='hidden';
      }
    }
  }
}
function ApareceContato(){
  with(document.all.menu.style){
  visibility='visible';
  }
}
function ApagaContato(){
  with(document.all.menu.style){
  visibility='hidden';
  }
}

//contato
function contato(pUrl,pTit,pLX,pAY) {
  var xx=50;
  var yy=50;
  if (navigator.appVersion.substring(0,1)>3) {
    xx=((screen.width-pLX-8)/2);
    yy=((screen.height-pAY-15)/2);
  }
  window.open(pUrl,pTit,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+pLX+',height='+pAY+',top='+yy+',left='+xx+',screenX='+xx+',screenY='+yy);
}

//abre
function abre(pUrl,pTit,pLX,pAY) {
  var xx=50;
  var yy=50;
  if (navigator.appVersion.substring(0,1)>3) {
    xx=((screen.width-pLX-8)/2);
    yy=((screen.height-pAY-15)/2);
  }
  window.open(pUrl,pTit,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,copyhistory=no,width='+pLX+',height='+pAY+',top='+yy+',left='+xx+',screenX='+xx+',screenY='+yy);
}


//visa e vitrines
var pagina = "br.terra.compras/visa12060";
var abc=Math.random() + "";
var Num=abc.substring(2,abc.length);

//buscador
function campoBlanco(campo)
{
  var cadena=campo.value;
  for(var i=0;i<cadena.length;i++)
  {
    var c=cadena.charAt(i);
    if(c!=" ")
    {
      return false;
    }
  }
  return true;
}

function campoVacio(form)
{
  campo=form.producto;
  c=form.categoria;
  co=form.store;
  longitud=campo.value.length;
  if(longitud<=0||campoBlanco(campo))
  {
    if((c!=null&&c.value=="TC")||((c!=null&&c[1].checked)||(co!=null&&co[1].checked)))
    {
      alert("Informe o produto que deseja buscar.");
      campo.focus();
      return false;
    }
  }
  else return true;
}

//promocao dotz
function abreCadastro(url,w,h) {
   window.open(url,"cadastro","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width="+w+",height="+h+",left=400,top=0")
}

//-->

