﻿// The collection of validators
var g_validatorArray = [];

// The function called by the user controls to validate its contents
function registerValidator(validationFunction)
{
    // Add this item to the collection
    g_validatorArray[g_validatorArray.length] = validationFunction;
}

// The function called to manage the update requests to the client
function updateUI()
{
    var navigatorState = true;
    for(currentValidatorIndex in g_validatorArray)
    {
        if (!g_validatorArray[currentValidatorIndex]())
        {
            navigatorState = false;
        }
    }
    if (typeof setNavigatorEnabledState == "function")
    {
        setNavigatorEnabledState(navigatorState);
    }
}

// Start the timer
var g_checkupTimer = window.setInterval("updateUI();", 400);
