﻿$(document).ready(function() {
    // only need to call the data every 2.5 minutes, data is cached for 5mins, so 2.5 is the average amount of wait before data is updated.
    setInterval(GetFlightInfo, 150000);    
});

function GetFlightInfo() {
    $.get('/common/handlers/departures.ashx', function(data) {
        $('#flights-body').html(data);
        SetRowColors();
        $.get('/common/handlers/departures-updated.ashx', function (data) {
            $("#arrivals-departures-updated").html(data);
        });
    });
}

function SetRowColors() {
    $("#flights tr:odd").addClass("row");
    $("#flights tr:even").addClass("alt-row");
}
