function showHideLogin(action){
	var ac = action;
	if(ac == 'open'){
	document.getElementById("div_login_closed").style.visibility = 'hidden';
	document.getElementById("div_login_closed").style.display = 'none';
	document.getElementById("div_login_open").style.visibility = '';
	document.getElementById("div_login_open").style.display = '';
	}
	
	if(ac == 'close'){
	document.getElementById("div_login_closed").style.visibility = '';
	document.getElementById("div_login_closed").style.display = '';
	document.getElementById("div_login_open").style.visibility = 'hidden';
	document.getElementById("div_login_open").style.display = 'none';
	}
}


function validaScript() {
try {
replaceTags(document.getElementById("tx_dc_email"));
replaceTags(document.getElementById("tx_dc_senha"));
replaceTags(document.getElementById("ic_lembrar_senha"));
} catch (e) {
return true;
}
return false
}


function replaceTags(elemento) {
elemento.value = elemento.value.replace(/</g, "&lt;");
elemento.value = elemento.value.replace(/>/g, "&gt;");
elemento.value = elemento.value.replace(/['\'']+/g, "&apos;");
elemento.value = elemento.value.replace(/["\""]+/g, "&#x22;");
elemento.value = elemento.value.replace(/[)]+/g, "&#x29;");
elemento.value = elemento.value.replace(/[(]+/g, "&#x28;"); 
}

if(document.getElementById("div_teste") != null){
	setTimeout("teste()", 20000);
	   function teste()
	   {
		document.getElementById("div_teste").style.visibility = 'hidden';
		document.getElementById("div_teste").style.display = 'none';
	   }
		function fechar()
		{
			if(document.getElementById("div_teste").style.visibility == 'visible')
			document.getElementById("div_teste").style.visibility = 'hidden' ;
		}
}

if (screen.width<640||screen.height<480)
window.location.href='http://wap.neotriad.com';

function AbreJanela(file, window, larg,  altura){
    msgWindow=open(file,window,'width=' + larg + ',height='  + altura + ',top=0,left=0');
    msgWindow.focus();
    msgWindow.moveTo(screen.width/2-larg/2,screen.height/2-altura/2-20);
}


function showMenu(div_id)
{
var divId = div_id	
		
			if(document.getElementById(divId).style.display == '' || document.getElementById(divId).style.display == 'none' ){			
			document.getElementById(divId).style.display='';
			document.getElementById(divId).style.visibility='visible';
			}				
}

function limite(limite){ 
var tt = document.getElementById("depoimento").value.length;          
var resta = limite - tt; 
var y = event.keyCode; //8 = backspace 
	if( (resta < 0) && (y != 8) ){
	alert("Erro! O número de caracteres foi ultrapassado.");		
	resta = 0;
	return false;
	}
var restam = limite - tt
	if(restam < 0){
	restam = 0;
	}	
document.getElementById("faltam").innerHTML = "Restam: "+ (restam) +" caractéres";
}

function LerCookie(valor) {
    var strNomeIgual = "neotriad_log=";
    
    var arrCookies = document.cookie.split(';');

    for (var i = 0; i < arrCookies.length; i++) {
        var strValorCookie = arrCookies[i];
        while (strValorCookie.charAt(0) == ' ') {
            strValorCookie = strValorCookie.substring(1, strValorCookie.length);
        }
        if (strValorCookie.indexOf(strNomeIgual) == 0) {
            var arrValues = strValorCookie.substring(strNomeIgual.length, strValorCookie.length).split('&');
            for (var a = 0; a < arrValues.length; a++) {
                var strValorValue = arrValues[a];
                while (strValorValue.charAt(0) == ' ') {
                    strValorValue = strValorValue.substring(1, strValorValue.length);
                }
                if (strValorValue.indexOf(valor) == 0) {
                    return strValorValue.substring(valor.length + 1, strValorValue.length);
                }
            }
        }
    }
    return null;
}