I have the following code to display a message daily,
<!doctype html>
<html>
<head>
<script type="text/javascript">
var msg = new Array();
Stamp = new Date();
today = Stamp.getDate();
msg[1] = "msg 1";
msg[2] = "msg 2";
msg[3] = "msg 3";
msg[4] = "msg 4";
msg[5] = "msg 5";
msg[6] = "msg 6";
msg[7] = "msg 7";
msg[8] = "msg 8";
msg[9] = "msg 9";
msg[10] = "msg 10";
msg[11] = "msg 11";
msg[12] = "msg 12";
msg[13] = "msg 13";
msg[14] = "msg 14";
msg[15] = "msg 15";
msg[16] = "msg 16";
msg[17] = "msg 17";
msg[18] = "msg 18";
msg[19] = "msg 19";
msg[20] = "msg 20";
msg[21] = "msg 21";
msg[22] = "msg 22";
msg[23] = "msg 23";
msg[24] = "msg 24";
msg[25] = "msg 25";
msg[26] = "msg 26";
msg[27] = "msg 27";
msg[28] = "msg 28";
msg[29] = "msg 29";
msg[30] = "msg 30";
msg[31] = "msg 31";
msg[32] = "msg 32";
msg[33] = "msg 33";
msg[34] = "msg 34";
.
.
.
.
msg[6000] = "end msg";
function writeMessage() {
document.write(msg[today]);
}
</script>
</head>
<body>
<strong>Daily Message:</strong>
<script>
writeMessage();
</script>
</body>
It displays message for all the days and then starts from first for the next month. What i want is to continue to display the next message, for example msg 32 should be displayed in the next month and so on till I come to the end message. Could you help me in modifying my code logic to achieve what I want?