I need a div to display when a scheduled tasks time matches the current server time. So basically, if I add a scheduled task for 8.15pm, at 8.15pm a div will be displayed...

I tried creating a script based on an RSS Ticker script (because it constantly checks the server for updates) but I'm stuck... I'm not even sure if I've programmed it right...

Anyway, enough blabbing... here's the code:

var schedAlertsAjaxObjects = new Array();

function showSchedAlerts(ajaxIndex,boxId,secondBetweenSlides)
    var alertContent = schedAlertsAjaxObjects[ajaxIndex].response;
    if (alertContent != "") {
        document.getElementById(boxId).style.display = '';

    Timeout('checkAlertsAjax("' + boxId + '",' + secondBetweenSlides + ')',secondBetweenSlides*1000);            
function checkAlertsAjax(boxId,secondBetweenChecks)
    var ajaxIndex = schedAlertsAjaxObjects.length;
    schedAlertsAjaxObjects[ajaxIndex] = new sack();
    schedAlertsAjaxObjects[ajaxIndex].requestFile = 'modules/clients/ajax-alerts.php';    // Specifying which file to get
    schedAlertsAjaxObjects[ajaxIndex].onCompletion = function(){ showSchedAlerts(ajaxIndex,boxId,secondBetweenChecks); };
    schedAlertsAjaxObjects[ajaxIndex].runAJAX();        // Execute AJAX function    
function initSchedAlerts()

window.onload = initSchedAlerts;
Basically how it should work is every 30 seconds, it should run an ajax command to check to see if there are any scheduled tasks in the database. When it finds a scheduled task, it gives a response and displays a DIV.

If it doesn't find a response it checks again, and again, and again every 30 seconds until it finds something or if you navigate away from the page.

I've got the AJAX part working but the part where it keeps checking for alerts when it doesn't find any is where I'm having dramas...

In the FireFox Error Console, it says:

Error: Timeout is not defined

Any ideas what I'm doing wrong or how I can get it to work?