function FormataValor(campo,tammax,teclapres){var tecla=teclapres.keyCode;vr=document.form[campo].value;vr=vr.replace("/","");vr=vr.replace("/","");vr=vr.replace(",","");vr=vr.replace(".","");vr=vr.replace(".","");vr=vr.replace(".","");vr=vr.replace(".","");tam=vr.length;if(tam<tammax&&tecla!=8){tam=vr.length+1;}
if(tecla==8){tam=tam-1;}
if(tecla==8||tecla>=48&&tecla<=57||tecla>=96&&tecla<=105){if(tam<=2){document.form[campo].value=vr;}
if((tam>2)&&(tam<=5)){document.form[campo].value=vr.substr(0,tam-2)+','+vr.substr(tam-2,tam);}
if((tam>=6)&&(tam<=8)){document.form[campo].value=vr.substr(0,tam-5)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);}
if((tam>=9)&&(tam<=11)){document.form[campo].value=vr.substr(0,tam-8)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);}
if((tam>=12)&&(tam<=14)){document.form[campo].value=vr.substr(0,tam-11)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);}
if((tam>=15)&&(tam<=17)){document.form[campo].value=vr.substr(0,tam-14)+'.'+vr.substr(tam-14,3)+'.'+vr.substr(tam-11,3)+'.'+vr.substr(tam-8,3)+'.'+vr.substr(tam-5,3)+','+vr.substr(tam-2,tam);}}
for(var ct=0;ct<document.form.elements.length;ct++){if(document.form.elements[ct].name==document.form.elements[campo].name){if(!teclapres.shiftKey&&tecla==9&&document.form.elements[ct+1]&&document.form.elements[ct+1].name=="senhaConta"&&document.applets['tclJava']){document.applets['tclJava'].setFocus();}}}}
function mascaraData(campoData,campoNext){var data=document.dadoscad[campoData].value;if(data.length==2){data=data+'/';document.dadoscad[campoData].value=data;return true;}
if(data.length==5){data=data+'/';document.dadoscad[campoData].value=data;return true;}
if(data.length==10&&campoNext!=""){document.dadoscad[campoNext].focus();return true;}}
function entregue(secao){document.getElementById(secao).style.visibility="visible";}
function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);}
function DisplayInfo(pagina,janela,w,h){window.open(pagina,janela,"width="+w+",height="+h+",scrollbars=auto,toolbar=no,location=no,status=yes,menubar=yes,resizable=yes,left=50,top=50")}
function imprimir(id){DisplayInfo("imprimir.php?id="+id,"imprimir",600,500,"yes","no");}
function artigos(cid){location.replace('$config[site]artigos.php?in=lista&cid='+cid);}
function DisplayInfo(pagina,janela,w,h,scrolling){if(!scrolling){scrolling="auto"}resultado=window.open(pagina,janela,"width="+w+",height="+h+",scrollbars="+scrolling+",toolbar=no,location=no,status=yes,menubar=yes,resizable=yes,left=5,top=5")}
function boldThis(from){strSelection=document.selection.createRange().text
if(strSelection==""){return false;}
else document.selection.createRange().text="<b>"+strSelection
+"</b>"
return;}
function italicThis(from){strSelection=document.selection.createRange().text
if(strSelection==""){return false;}
else document.selection.createRange().text="<i>"+strSelection
+"</i>"
return;}
function underlineThis(from){strSelection=document.selection.createRange().text
if(strSelection==""){return false;}
else document.selection.createRange().text="<u>"+strSelection
+"</u>"
return;}
function changecolor(t){strSelection=document.selection.createRange().text
if(strSelection==""){return false;}
else document.selection.createRange().text="<font"+" color"+"="+t+">"+strSelection
+"</font>"
return;}
function changesize(t){strSelection=document.selection.createRange().text
if(strSelection==""){return false;}
else document.selection.createRange().text="<font"+" class"+"="+t+">"+strSelection
+"</font>"
return;}
function nbspThis(from){strSelection=document.selection.createRange().text
if(strSelection==""){alert("Selecione um caracter..");}
else document.selection.createRange().text="    "
return;}
function produtos(tipo,id,cid){if(tipo=='1'){location.replace('$config[site]admin/?on=produtos&in=novo_prod&cid='+cid);}else{location.replace('$config[site]admin/?on=produtos&in=editar_produto&id='+id+'&cid='+cid);}}
function clearall(form){form.reset();}
function changeLine(name,opt){var lista=document.getElementsByName(name);for(i=0;i<lista.length;i++){lista[i].style.background=opt;}}
function verifica_contato(){nome=document.contato.nome.value;if(nome==""){alert("Favor informar seu nome");contato.nome.focus();return false;}
email=document.contato.email.value;if(email==""){alert("Favor informar seu e-mail");contato.email.focus();return false;}
else{if(email.indexOf("@")==-1){alert("Informe um e-mail válido.");contato.email.focus();return false;}}
mensagem=document.contato.mensagem.value;if(mensagem==""){alert("Favor informar a mensagem");contato.mensagem.focus();return false;}}
function verifica_orcamento(){nome=document.orcamento.nome.value;if(nome==""){alert("Favor informar seu nome");orcamento.nome.focus();return false;}
email=document.orcamento.email.value;if(email==""){alert("Favor informar seu e-mail");orcamento.email.focus();return false;}
else{if(email.indexOf("@")==-1){alert("Informe um e-mail válido.");orcamento.email.focus();return false;}}
telefone=document.orcamento.telefone.value;if(telefone==""){alert("Favor informar seu telefone");orcamento.telefone.focus();return false;}}
function clickBtnDireito(){if(event.button==2||event.button==3){oncontextmenu='return false';}}
document.onmousedown=clickBtnDireito
document.oncontextmenu=new Function("return false;")
