// JavaScript Document

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function voltar() {
	history.go(-1);
}

function imprimir() {
	window.print();
}


// window open
var url;
function abre(url,w,h,scr) {
	window.open(url,'comentarios','width='+w+',height='+h+',directories=0,location=0,menubar=0,resizable=1,scrollbars='+scr+',status=0,toolbar=0,marginleft=0,margintop=0,left=25,top=25');
}


<!--
// Exibe ou esconde id com Style Display
function mostra(item){
    if (document.getElementById(item).style.display=='none'){
        document.getElementById(item).style.display='';
    } else {
        document.getElementById(item).style.display='none'
    }
}



// retira espaços em branco
function retiraEspacos(string) {
    var i = 0;
    var final = '';
    while (i < string.length) {
        if (string.charAt(i) == ' ') {
            final += string.substr(0, i);
            string = string.substr(i+1, string.length - (i+1));
            i = 0;
        }
        else {
            i++;
        }
    }
    return final + string;
}	
-->


function VerificarGrauDaSenha(senha) {
        var points = 0;
        var descr = new Array();
        descr[0] = "Muito fraco";
        descr[1] = "Fraco";
        descr[2] = "Razoável";
        descr[3] = "Médio";
        descr[4] = "Forte";
        descr[5] = "Muito forte";

        // grau se o temanho é maior que 4 caracteres, aumenta 1 ponto
        if (senha.length > 4) points++;
        // grau se a senha contém caracteres maiúsculos e minúsculos, aumenta 1 pto
        if ( ( senha.match(/[a-z]/) ) && ( senha.match(/[A-Z]/) ) ) points++;
        // grau se a senha tem algum número, aumenta 1 ponto
        if (senha.match(/\d+/)) points++;
        // grau se a senha tem algum caractere especial, aumenta 1 ponto
        if ( senha.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) )    points++;
        // grau se o tamanho da senha for maior que 12, aumenta 1 ponto
        if (senha.length > 12) points++;
        // muda descrição e a classe do div conforme o grau da senha
        document.getElementById("descricaoGrau").innerHTML = descr[points];
        document.getElementById("grauSenha").className = "grau" + points;
    }
