var g_bImgOpen = false;
//var g_tView = null;
var g_tPicBox = null;
var g_tBigPic = null;

function img_position(tImg)
{
    var iTnX, iTnY, tElem;

    iTnX = 0;
    iTnY = 0;
    tElem = tImg;
    while (tElem)
    {
        iTnX += tElem.offsetLeft;
        iTnY += tElem.offsetTop;
        if (tElem != tImg && tElem != g_tView)
        {
            iTnX -= tElem.scrollLeft;
            iTnY -= tElem.scrollTop;
        }
        tElem = tElem.offsetParent;
    }

    return [ iTnX, iTnY ];
}

function img_enlarge(sId, sSrc)
{
    var tTn, tPos, tBoxLeft, iBoxTop;

    if (!g_bImgOpen)
    {
        g_bImgOpen = true;
        tTn = document.getElementById(sId);
        //if (g_tView == null) 
        g_tView = document.getElementById("main3");
        if (g_tBigPic == null) g_tBigPic = document.getElementById("big_pic");
        if (g_tPicBox == null) g_tPicBox = document.getElementById("big_pic_box");

        g_tBigPic.src = sSrc;

        tPos = img_position(tTn);

        iBoxLeft = tPos[0] + tTn.offsetWidth - 399;
        iBoxTop = tPos[1] + tTn.offsetHeight - 239;
        g_tPicBox.style.top = iBoxTop + "px";
        g_tPicBox.style.left = iBoxLeft + "px";
        g_tPicBox.style.display = "block";
        tPos = img_position(g_tBigPic);
     //   if (tPos[1] < g_tView.scrollTop)
      //  {
       //     iBoxTop += g_tView.scrollTop - tPos[1];
        //    g_tPicBox.style.top = iBoxTop + "px";
       // }
    }
}

function img_reduce()
{
    g_tPicBox.style.display = "none";
    g_tBigPic.src = "/images/space.gif";
    g_bImgOpen = false;
}


function confirmDelete()
{
  var confirmation = confirm('Are you sure you want to DELETE this Account?');
  if (confirmation)
  {
    return true;
  }

  return false;
}

