var currentRow;
var rowId;
var deleteButton;

function DeleteRow(row, id, imageButton)
{
    this.currentRow = row;
    currentRow.originalcolor=currentRow.style.backgroundColor;
    imageButton.blur();
    this.deleteButton = imageButton;
    this.rowId = id;
    this.popUp = $find('DeletePopUpBehavior');
    this.popUp.show();
    return false;
}

function DeleteOkClick()
{
    DeleteCallBack(this.rowId);
}

function DeleteAccount(result, context)
{
    if(result == "success")
    {
        // play animation
        deleteButton.src = "../Images/ActivityIndicator.gif";

        var animations = new Array();
        Array.add(animations, new AjaxControlToolkit.Animation.ColorAnimation(currentRow, .5, 20, "style", "backgroundColor", "#FFFF90", "#FFFFFF"));
        Array.add(animations, new AjaxControlToolkit.Animation.ColorAnimation(currentRow, .5, 20, "style", "color", "#000000", "#FFFFFF"));
        Array.add(animations, new AjaxControlToolkit.Animation.HideAction(currentRow, 0, 0));
        AjaxControlToolkit.Animation.SequenceAnimation.play(currentRow, 0, 0, animations, 1);
    }
    else if(result.length > 10)
    {
        alert(result);
    }
}

function SetGridViewHoverOn(gridView)
{
    if(gridView != null)
    {
        gridView.originalBgColor = gridView.style.backgroundColor;
        gridView.style.backgroundColor='#FFFFCC';
    }
}

function SetGridViewHoverOff(gridView)
{
    if(gridView != null)
    {
        gridView.style.backgroundColor = gridView.originalBgColor;
    }
}
