﻿function changeBackgroundImage(objID, img) {
    document.getElementById(objID).style.backgroundImage = 'url(' + img + ')'
}

function changeSet1DivVisible(objName, objNumber) {
    for (var i = 0; i <= 20; i++) {
        if (document.getElementById(objName + i) != null) {
            if (i != objNumber)
                document.getElementById(objName + i).style.visibility = 'hidden';
            else
                document.getElementById(objName + i).style.visibility = 'visible';
        }
    }
}

function GridRowChangeColor(rowIndex,gridId) {
    var grid = document.getElementById(gridId);
    var index = 0;
    for (index = 0; index < grid.rows.length - 1; index++) {
        if (index == rowIndex) {
            if (grid.rows[index + 1].style.backgroundColor == '#ffffff' || grid.rows[index + 1].style.backgroundColor == '') {
                grid.rows[index + 1].style.backgroundColor = '#3674a9';
                grid.rows[index + 1].style.color = '#ffffff';
                grid.rows[index + 1].getElementsByTagName("a").item(0).style.color = "#ffffff";
                grid.rows[index + 1].getElementsByTagName("a").item(1).style.color = "#ffffff";
            } else {
                grid.rows[index + 1].style.backgroundColor = '#ffffff';
                grid.rows[index + 1].style.color = '#000000';
                grid.rows[index + 1].getElementsByTagName("a").item(0).style.color = "#3674a9";
                if (grid.rows[index + 1].getElementsByTagName("a").item(1) != null) {
                    grid.rows[index + 1].getElementsByTagName("a").item(1).style.color = "#3674a9";
                }

            }
        }
        else {
            grid.rows[index + 1].style.backgroundColor = '#ffffff';
            grid.rows[index + 1].style.color = '#000000';
            grid.rows[index + 1].getElementsByTagName("a").item(0).style.color = "#3674a9";
            if (grid.rows[index + 1].getElementsByTagName("a").item(1) != null) {
                grid.rows[index + 1].getElementsByTagName("a").item(1).style.color = "#3674a9";
            }
            
        }
        grid.rows[index + 1].style.cursor = "pointer";
    }
}

