Corroboro que en IE8 funciona correctamente.
Te paso el fichero, comprueba que lo tengas igual.
Código htm:
Ver original<html>
<head>
<script>
var fechaVenc = vencimientos = new Array();
vencimientos["00"] = 02;
vencimientos["01"] = 02;
vencimientos["02"] = 02;
vencimientos["03"] = 02;
vencimientos["04"] = 03;
vencimientos["05"] = 03;
vencimientos["06"] = 03;
vencimientos["07"] = 03;
vencimientos["08"] = 04;
vencimientos["09"] = 04;
vencimientos["10"] = 04;
function calcular( numero, pago ){
var cifras = numero.substr( numero.length - 2 );
var fecha = vencimiento(cifras);
var hoy = new Date();
var dia = hoy.getDate();
var esteMes = hoy.getMonth();
var sgteMes = 0;
var esteAno = hoy.getFullYear();
var sgteAno = 0;
if(dia > fecha){
if(esteMes == 11){
sgteMes = 0;
sgteAno = esteAno + 1;
}else{
sgteMes = esteMes + 1;
sgteAno = esteAno;
}
}else{
sgteMes = esteMes;
sgteAno = esteAno;
}
var fechaVenc = new Date();
fechaVenc.setFullYear(sgteAno);
fechaVenc.setMonth(sgteMes);
fechaVenc.setDate(fecha);
var diasFaltan = fechaVenc.valueOf() - hoy.valueOf();
diasFaltan = diasFaltan / (1000 * 60 * 60 * 24);
var faltaPagar = pago / 30 * parseInt(diasFaltan);
alert(parseInt(faltaPagar));
}
function vencimiento(cifras){
return vencimientos[cifras];
}
</script>
</head>
<body>
<form>
<p><input type="text" value="" name="num">
<input type="text" value="" name="pag">
<input type="button" onClick="calcular(this.form.num.value, this.form.pag.value);" value="Calcular">
</p>
</form>
</body>
</html>