I have the following script (which I modified from another post) to pop-up an alert box during specific days/times. I can get the alerts to pop-up when I use a button – onclick. But when I add the day/time function I get an object expected when I click any of the buttons that call the functions. I know it must be syntax error, but I can’t figure it out. thanks.
<SCRIPT LANGUAGE=”text/JavaScript”>
function drawAlertsat () {
alert (“The site is undergoing scheduled maintenance until Sunday 6:00 am (EST). You may experience problems signing in during this scheduled maintenance period.”);
}
function drawAlertsun () {
alert (“The site is undergoing scheduled maintenance until Monday 1:00 am (EST). You may experience problems signing in during this scheduled maintenance period.”);
}
function drawAlertwkday () {
alert (“The site is undergoing scheduled maintenance until Thursday 2:00 am (EST). You may experience problems signing in during this scheduled maintenance period.”);
}
var today=new Date();
function MntAlert(today.getDay()) {
case 0:
if today.getHours()<6 {
drawAlertsat();
}
if today.getHours()>8 {
drawAlertSun;
}
break;
case 1:
if today.getHours()<1 {
drawAlertSun();
}
break;
case 3:
if today.getHours()>=22 {
if today.getDate()<=7 {
drawalertwkday();
break;
}
if today.getDate()<=21&&today.getDate()>=15 {
drawalertwkday();
}
}
break;
case 4:
if today.getHours()<2 {
drawAlertwkday();
}
break;
case 6:
if today.getHours()=23 {
if today.getminutes()>=45 {
drawAlertsat();
}
}
break;
}
</SCRIPT>