﻿// JScript File
function HideRow()
{
    tableDates = document.getElementById("agent_scedule");
    if (tableDates != null)
    {
        var currentTime = new Date();
        var month = currentTime.getMonth() + 1;
        var day = currentTime.getDate();
        var year = currentTime.getFullYear();

        var i = 0
        for (i=0; i < tableDates.rows.length; i++)
        {
            if (tableDates.rows[i] != null)
            {
                if (tableDates.rows[i].cells[1] != null)
                {
                    if (tableDates.rows[i].cells[1].innerHTML.search(/\d\d.\d\d.\d\d\d\d/) != -1)
                    {
                        var smonth = tableDates.rows[i].cells[1].innerHTML.substring(0,2);
                        var sday = tableDates.rows[i].cells[1].innerHTML.substring(3,5);
                        var syear = tableDates.rows[i].cells[1].innerHTML.substring(6,10);
                        if ((syear < year) ||
                            ((syear == year) && (smonth < month)) ||
                            ((syear == year) && (smonth == month) && (sday < day))
                           )
                        {
                            tableDates.rows[i].style.display = 'none';
                        }
                    }
                }
            }
        }
    }
}

