﻿// JScript File

var curRow;
var origBackColor;

function GetDetail(obj)
{
    var caseNumber = obj.innerText;
    SelectRow(obj);
    return caseNumber;
}

function SelectRow(obj)
{
	var row = obj.parentElement.parentElement;
	if(curRow != null && curRow == row)
		return;
	
	if(origBackColor != null)
	{
		curRow.style.backgroundColor = origBackColor;
		curRow.style.color = "black";
	}
		
	origBackColor = row.style.backgroundColor;
	curRow = row;
	row.style.backgroundColor = "#483D8B";
	row.style.color = "#F8F8FF";
}

function CaseNumber_CallBack(result, context)
{
    document.getElementById("divDetail").innerHTML = result;
    SlcSessionTimerReset("<%= Session.Timeout * 60 %>");
}

function ResizeDiv()
{
    var div = document.getElementById("divCase");
    var grid = document.getElementById("gvCase");
    
    if(grid != null && grid.offsetHeight < 250)
        div.style.height = grid.offsetHeight + 5;
}

function SlcGetYear() {
    var slcDate = new Date();
    return slcDate.getFullYear();
}