﻿// CELULAR
function cel(){
if (document.form_alt.cel_rep.value.length == 1){
document.form_alt.cel_rep.value = "(" + document.form_alt.cel_rep.value; }
if (document.form_alt.cel_rep.value.length == 3){
document.form_alt.cel_rep.value = document.form_alt.cel_rep.value + ")"; }
if (document.form_alt.cel_rep.value.length == 8){
document.form_alt.cel_rep.value = document.form_alt.cel_rep.value + "-";}
}

// TELEFONE
function fone(){
if (document.form_alt.fone_rep.value.length == 1){
document.form_alt.fone_rep.value = "(" + document.form_alt.fone_rep.value; }
if (document.form_alt.fone_rep.value.length == 3){
document.form_alt.fone_rep.value = document.form_alt.fone_rep.value + ")"; }
if (document.form_alt.fone_rep.value.length == 8){
document.form_alt.fone_rep.value = document.form_alt.fone_rep.value + "-";}
}


// SOMENTE NUMEROS

function somente_numero(campo){  
var digits="0123456789"  
var campo_temp   
    for (var i=0;i<campo.value.length;i++){  
        campo_temp=campo.value.substring(i,i+1)   
        if (digits.indexOf(campo_temp)==-1){  
            campo.value = campo.value.substring(0,i);  
        }  
    }  
}  
  



// RESET VALOR DO INPUT
function limpaCapo(campo, valor) {
if (campo.value == valor) {
campo.value = "";
}
}
function resetCampo(campo, valor) {
if (campo.value == "") {
campo.value = valor;
}
}


// MENU ANIMA
var duracao = 250;
$(document).ready(function(){
						   
$("#lang li").hover(function(){
		$(this).stop().animate({marginTop: -4}, duracao);
},function(){
		$(this).stop().animate({marginTop: 0}, duracao);
});

$("#nav li").hover(function(){
		$(this).stop().animate({marginLeft: 5}, duracao);

},function(){
		$(this).stop().animate({marginLeft: 0}, duracao);
});

});

// MENU DROPDOWN

// JavaScript Document

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;
