function IEHoverPseudo() {
	var navItems = document.getElementById("menu").getElementsByTagName("li");
	for (var i=0; i < navItems.length;  i++) {
		if( navItems[i].className == "submenu") {
			navItems[i].onmouseover=function() { this.className += " over "; }
			navItems[i].onmouseout=function() { this.className = "submenu"; }
		}
	}
}
window.onload = IEHoverPseudo;
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function cad_novo_email_conf(){
	if(document.cad_novo.email.value!=document.cad_novo.email_confirmacao.value){
		alert("O email não é o mesmo na confirmação");
		document.cad_novo.email.focus();
		return false;
	}
}

// função para tabulação, são passados os valores this e o número de caracteres
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len) {
    var keyCode = (isNN) ? event.which : event.keyCode; 
    var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
    if(input.value.length >= len && !containsElement(filter,keyCode)) {
        input.value = input.value.slice(0, len);
        input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
    var found = false, index = 0;
    while(!found && index < arr.length)
        if(arr[index] == ele)
            found = true;
        else
            index++;
        return found;
    }
function getIndex(input) {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
        if (input.form[i] == input)index = i;
        else i++;
        return index;
    }
return true;
}
// Fim da função de tabulação
function cad_novo_senha_conf(){
	if(document.cad_novo.senha.value!=document.cad_novo.senha_confirmacao.value){
		alert("A senha não é a mesma na confirmação");
		document.cad_novo.senha.focus();
		return false;
	}
}
function valida_email(vemail){
	if(vemail == '' || vemail.indexOf('@') == -1 || vemail.indexOf('.') == -1){
		return false
	}else{
		return true
	}
}
