semanas = ["segunda", "terça", "quarta", "quinta", "sexta", "sábado", "domingo"];
meses = ["jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez"];
largDia = 15;
largSemana = 68;
largMes = 38;
largura = 500;
posx = (largura-largDia)/30;
posx_se = (largura-largSemana)/6;
posx_me = (largura-largMes)/11;
nd = new Date();
estilo = new TextFormat();
estilo.font = "arial";
estilo.color = 0xffffff;
estilo.size = 10;
estilo.align = "center";
for (i=1; i<=31; i++) {
createTextField("diames"+i, i, posx*(i-1), 25, largDia, 18);
with (this["diames"+i]) {
text = i;
background = true;
backgroundColor = 0x006666;
setTextFormat(estilo);
}
eval("diames"+nd.getDate()).backgroundColor = 0xff0000;
}
for (b=1; b<=7; b++) {
createTextField("diasemana"+b, b+50, posx_se*(b-1), 0, largSemana, 18);
with (this["diasemana"+b]) {
text = semanas[b-1];
background = true;
backgroundColor = 0x006666;
setTextFormat(estilo);
}
eval("diasemana"+nd.getDay()).backgroundColor = 0xff0000;
}
for (c=1; c<=12; c++) {
createTextField("mensal"+c, c+100, posx_me*(c-1), 50, largMes, 18);
with (this["mensal"+c]) {
text = meses[c-1];
background = true;
backgroundColor = 0x006666;
setTextFormat(estilo);
}
eval("mensal"+(nd.getMonth()+1)).backgroundColor = 0xff0000;
}
createTextField("ano", 77, 0, -25, largura, 18);
with (ano) {
text = nd.getFullYear();
background = true;
backgroundColor = 0xff0000;
setTextFormat(estilo);
}