// JavaScript Document

function jsMouseImageEvent(e, sImage) 
{
	e.src = "images/" + sImage;	
}

function jsSideMenuMouseEvent(e, sCommand)
{
	if (sCommand == "over") {
		e.style.textDecoration	= "underline";
		e.style.color = "#0058A6";
		e.style.cursor = "hand";
	} else {
		e.style.textDecoration = "none";
		e.style.color = "#333333";
		e.style.cursor = "default";
	}
}

function jsPageRedirect(sURL) 
{
	window.location = sURL;
}

var gLastExpTasks = null;

function expandcollapse(obj,row)
{
    var div = document.getElementById(obj);
    var img = document.getElementById('img' + obj);
    
    if (div.style.display == "none")
    {
        div.style.display = "block";
        if (row == 'alt')
        {
            img.src = "images/collapsed.gif";
        }
        else
        {
            img.src = "images/expanded.gif";
        }
        img.alt = "Close to view other incidents";
        gLastExpTasks = obj;
    }
    else
    {
        div.style.display = "none";
        if (row == 'alt')
        {
            img.src = "images/collapsed.gif";
        }
        else
        {
            img.src = "images/collapsed.gif";
        }
        img.alt = "Expand to show tasks";
    }
} 

function jsReloadExpTasks()
{
    if (gLastExpTasks != null)
    {
        expandcollapse(gLastExpTasks, 'one');
    }
}
