$(document).ready(function() {

    if($('#change').length > 0)
    {
        var sBGcolTd;
        var sBGcolTr;
        var index;
        var aTrs = $('#change1 tr');
        
        $('#change table#change1 tbody td').mouseover(function()
        {
            sBGcolTd = $(this).css('background-color');
            sBGcolTr = $(this).parent().children('th:first').css('background-color');

            index = this.cellIndex - 1;

            $(this).parent().children('td').css('background-color', '#FFE6B2');
            $(this).parent().children('th:first').css('background-color', '#99B2FF')

            for (var i=1; i<6; i++)
            {
                $('td', aTrs[i]).eq(index).css('background-color', '#FFE6B2');
            }

            $(this).css('background-color', '#FFCC80');

            $(aTrs[0]).children('th').eq(index+1).css('background-color', '#99B2FF');
        });

        $('#change table#change1 tbody td').mouseout(function()
        {
            $(this).parent().children('td').css('background-color', sBGcolTd);
            $(this).parent().children('th:first').css('background-color', sBGcolTr)

            for (var i=1; i<6; i++)
            {
                $(aTrs[i]).children('td').eq(index).css('background-color', sBGcolTd);
            }

            $(aTrs[0]).children('th').eq(index+1).css('background-color', sBGcolTr);
        });
    }
});
