// JavaScript Documentsd
function verificaTrocaSenha() {
	
	if (document.getElementById('mSenhaAtual').value != document.getElementById('mSenha1').value) {
		if (document.getElementById('mSenha1').value == document.getElementById('mSenha2').value) {
			return document.formSenhas.submit();
		} else {
			alert ('Nova Senha não confere');
			return false;	
		}
	} else {
		alert ('Nova Senha deve ser diferente da atual');
		return false;
	}
}


function esqueciSenha(num) {
	window.open('http://www.idealinvest.com.br/portal/pravaler/esqsenha.php?cpf='+num, 'esqse', 'width=200, height=120, scrollbars=no, statusbar=yes, screenX=100, screenY=100')
	window.location.href="http://www.creditopravaler.com.br";
}


function calcMens(mens,atr) {
	window.open('http://www.idealinvest.com.br/portal/pravaler/calcmens.php?mens='+mens +'&atr='+atr, 'mensa', 'width=350, height=250, scrollbars=no, statusbar=yes, screenX=150, screenY=150')
}


function interesse() {
	window.open("http://www.idealinvest.com.br/portal/pravaler/interesse.php", "pravalerInteresse", "width=480, height=450, screenX=150, screenY=100, scrollbars=yes");
}

function justNum(e,txt) {

var navegador = (navigator.appName == "Netscape") ? "NT" : "IE";
var charCode = (navegador == "NT") ? e.which : e.keyCode;

//alert(charCode);
	if (charCode != 0 && charCode != 8 && (charCode  < 48 || charCode  > 57)) {
		if (navegador=="NT") {
			return e.preventDefault(); 
		}
		else {
			e.returnValue = false;
		}
	} else {
		if (txt.value.search(",") >= 0 && charCode == 44 && charCode == 46 && charCode == 8) {
			if (navegador=="NT") {
				return e.preventDefault(); 
			} else {
				e.returnValue = false;
			}
		}
	}
}

function floatkey(e,txt) {

var navegador = (navigator.appName == "Netscape") ? "NT" : "IE";
var charCode = (navegador == "NT") ? e.which : e.keyCode;
	
//alert(charCode);
	 if (charCode == 44 || charCode == 46){
		if (charCode == 46){
			charCode = null;
		}
		//alert(txt.value.length);
		if (txt.value.length > 0){
			temvirg = txt.value.indexOf(',');
			tempont = txt.value.indexOf('.');				
			if (temvirg >= 1 || tempont >= 1){
				charCode = null;
			}
		}else{
			charCode = null;
		}
	 }
	
	if (charCode != 0 && charCode != 8 && charCode != 44 && charCode != 46 && (charCode  < 48 || charCode  > 57)) {
		if (navegador=="NT") {
			return e.preventDefault(); 
		}
		else {
			e.returnValue = false;
		}
	} else {
		if (txt.value.search(",") >= 0 && charCode == 44 && charCode == 46 && charCode == 8) {
			if (navegador=="NT") {
				return e.preventDefault(); 
			} else {
				e.returnValue = false;
			}
		}
	}
}