


function toggle (c) {
	var cn = c.className;
	if (cn == "" || cn == 'hideAns')  c.className='showAns';
	if (cn =='showAns') c.className='hideAns';
}

function parseFormat(num){
	var entero, decimal
	var numero = "" + num + ""
	if(numero.indexOf(".") != -1)
		decimal = numero.substring(numero.indexOf("."), (numero.indexOf(".")+3))
	else
		decimal = ".00"
	entero = "" + parseInt(numero) + ""
	var l = entero.length
	var s = l - 3
	while(s > 0){
		entero = entero.substring(0,s) + "," + entero.substring(s,l+1)
		s = s - 3
	}
	numero = entero + decimal
	return numero
}


function calcularTodos() {
		var valbien = parseInt( listaprecios.value);


		inicial=0.03;
  tasa = 0.0115;
		
    valor = (parseInt(listaprecios.value) * inicial) ;
    inscrip.value = parseFormat(valor);
    valor1 = (parseInt(listaprecios.value) * tasa) ;
				mensual.value = parseFormat(valor1);
		}

function calcularTodos1() {
		var valbien = parseInt( listapreciosA.value);

  inicial=0.04;
  tasa = 0.02;
		
    valor = (parseInt(listapreciosA.value) * inicial) ;
    inscrip1.value = parseFormat(valor);
    valor1 = (parseInt(listapreciosA.value) * tasa) ;
				mensual1.value = parseFormat(valor1);
		}


function confirmacambioclave(dato1,dato2,dato3) { 
	if (dato1.length == 0 || dato2.length == 0 || dato3.length == 0) {
		alert("Debe llenar todos los campos.");
		return
	}
	else {

		if (dato2 == dato3) {
		cambioclave.action = "ConfirmaCambioClave.asp" ;
		}
		else {
		alert("La clave nueva no coincide con la reconfirmación");
		return
		}

	}
}
function validaSeleccion(dato) { 
	if (dato.length == ' ') {
		alert("Debe hacer su selección y luego presionar Continuar.");
	}
}

function ValidaConfirmaClave(dato1,dato2,dato3) { 

		if (dato1 == '' || dato2 == '' || dato3 == '') {
		alert("Por favor llene todos los campos.");
		}
		else{
			if (dato2 !== dato3) {
			alert("La nueva clave y la confirmación no coinciden.");
			}

		}
}


