function checa(obj, focou, padrao){
  if (focou){
    if(obj.value==padrao)
      obj.value='';
     else
       obj.select();
  } else {
    if (obj.value=='')
    obj.value=padrao;
  }
}

function checkSearch(){
  var erro = '';
  var focou = false;
  var objFocus = null;
  var form = document.getElementById('formBusca');

  if(form.arg.value.length == 0){
    erro += "  - Preencha o nome do produto a ser pesquisado\n";
    if(!focou){
      focou = true;
      objFocus = form.arg;
    }
  }

  if(erro!=''){
    alert("Corrija o(s) seguinte(s) erro(s):\n" + erro);
    objFocus.focus();
    return void(0);
  } else {
    form.submit();
    return void(0);
  }
}

function showHideMenu(id, linkObj){
  var obj = document.getElementById(id);
  if(obj == null || obj == "undefined")
    return void(0);
  if(obj.style.display == 'none'){
    obj.style.display = document.getElementById('rowModelo').style.display;
    linkObj.style.color = '#666666';
  } else {
    obj.style.display = 'none';
    linkObj.style.color = '#000000';
  }
}

function chColor(obj, newColor){
  obj.bgColor = newColor;
}
