/* reativa tags OBJECT no IE */function ieupdate(){  if(navigator.appName=="Microsoft Internet Explorer" || navigator.appName=="Opera"){    theObjects = document.getElementsByTagName("object");    for (var i = 0; i < theObjects.length; i++) {      theObjects[i].outerHTML = theObjects[i].outerHTML;    }  }}/*  Valida campos do formulário  vars  = array com os nomes dos campos a serem pesquisados  form  = nome do formulário de onde vem as variáveis  info  = mostra (ou não) mensagem de 'campos obrigatórios'        para campos de e-mail, colocar 'campo:1' para validação do e-mail */function fncCampos(vars, form, info){  for(var f=0; f<vars.length; f++){    var campo = vars[f].split(":");    fncRetSpc(eval("form."+campo[0]))    if(!eval("form."+campo[0]).value){      if(info) window.alert("Todos os campos marcados são de preenchimento obrigatório.");      eval("form."+campo[0]).focus();      return false;    }else{      if(campo[1]){        if(!fncValidaMail(eval("form."+campo[0]))){          if(info) window.alert("O e-mail parece incorreto.");          eval("form."+campo[0]).select();          return false;        }      }    }  }  return true;}/* campos apenas com números -> onKeyPress="return fncNumeros(event);" */function fncNumeros(e){  var whichCode = (window.Event)? e.which : e.keyCode;  if(whichCode>=48 && whichCode<=57 || whichCode==8 ||whichCode==32) return true;  return false;}/* retira espaços do inicio */function fncRetSpc(obj){  var ret = obj.value;  if(ret.substr(0, 1)==" "){    do{      ret = ret.substr(1);    }while(ret.substr(0, 1)==" ")    obj.value = ret;  }  return;}/* valida e-mail */function fncValidaMail(obj){  var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;  if (!re_mail.test(obj.value)) return false;  return true;}/* abre popup centralizado */function fncPopUp(pg, w, h, scr, centralizado){  var l = centralizado ? (screen.width/2) - (w/2) : 50;  var t = centralizado ? (screen.height/2) - (h/2) : 50;  var param = "width="+w+",height="+h+",left="+l+",top="+t+",scrollbars="+scr;  window.open(pg, '_popup', param);  return;}function fncPopUp2(pg, w, h, scr, centralizado){  var l = centralizado ? (screen.width/2) - (w/2) : 50;  var t = centralizado ? (screen.height/2) - (h/2) : 50;  var param = "width="+w+",height="+h+",left="+l+",top="+t+",scrollbars="+scr+",status=0,toolbar=0,menubar=0,location=0,directories=0";  window.open(pg, null, param);  return;}function popupPosicionado(URL,w,h,l,t){  day = new Date();  id = day.getTime();  eval("page" + id + " = window.open(URL,'" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+",left="+l+",top="+t+",modal=yes');");}function validaForm(){  if (document.forms[0].empresa.value=='') {    alert('Digite o nome da empresa ');    document.forms[0].empresa.focus();    return false;  }  if (document.forms[0].nome.value=='') {    alert('Digite o seu nome ');    document.forms[0].nome.focus();    return false;  }  if (document.forms[0].email.value=='') {    alert('Digite o E-mail ');    document.forms[0].email.focus();    return false;  }else{      if(document.forms[0].email.value.indexOf('@') < 1 || document.forms[0].email.value.indexOf('.') < 1){        alert('Email inválido');        document.forms[0].email.focus();        return false;      }  }  return true;}function validaFormEn(){  if (document.forms[0].empresa.value=='') {    alert('Type company name ');    document.forms[0].empresa.focus();    return false;  }  if (document.forms[0].nome.value=='') {    alert('Type your name ');    document.forms[0].nome.focus();    return false;  }  if (document.forms[0].email.value=='') {    alert('Type your e-mail address ');    document.forms[0].email.focus();    return false;  }else{      if(document.forms[0].email.value.indexOf('@') < 1 || document.forms[0].email.value.indexOf('.') < 1){        alert('Invalid e-mail address');        document.forms[0].email.focus();        return false;      }  }  return true;}function validaFormEs(){  if (document.forms[0].empresa.value=='') {    alert(' Campo obligatorio: empresa ');    document.forms[0].empresa.focus();    return false;  }  if (document.forms[0].nome.value=='') {    alert('Campo obligatorio: nombre ');    document.forms[0].nome.focus();    return false;  }  if (document.forms[0].email.value=='') {    alert('Campo obligatorio: e-mail ');    document.forms[0].email.focus();    return false;  }else{      if(document.forms[0].email.value.indexOf('@') < 1 || document.forms[0].email.value.indexOf('.') < 1){        alert('Email no válido');        document.forms[0].email.focus();        return false;      }  }  return true;}function validaPesquisa(idioma){  var ms;  if(idioma==0){ms="Campo obrigatório";ms1="Selecione uma opção";}  if(idioma==1){ms="Mandatory field";ms1="Select an option";}  if(idioma==2){ms="Campo obligatorio";ms1="Selecione uma opção";}  if (document.homesearch.parametro.value=='') {    alert(ms);    document.homesearch.parametro.focus();    return false;  }  if (document.homesearch.rdotipo[0].checked==false&&document.homesearch.rdotipo[1].checked==false) {    alert(ms1);    document.homesearch.rdotipo[0].focus();    return false;  }  return true;}// Funções para o popup natalfunction fecharnatal(){document.getElementById('popupnatal').style.display = 'none';}function abrirnatal(){document.getElementById('popupnatal').style.display = 'block';}function abriraviso(){document.getElementById('popupaviso').style.display = 'block';}function fecharaviso(){document.getElementById('popupaviso').style.display = 'none';}
