﻿// JScript File

var b_stable = false;
var b_over = false;

function ShowCaption(parent, html)
{
    var x = document.getElementById('frag-photo-caption-item');
    b_over = true;
    
    if(x == null)
    {
        x = document.createElement('div');
        x.id = 'frag-photo-caption-item';
        x.className = 'frag-photo-caption-item';
        document.body.appendChild(x);

        x.onmouseover = function(ev)
        {
            ShowCaption(parent, html);
        }
        
        x.onmouseout = function(ev)
        {
            HideCaption();
        }
    }
    
    x.innerHTML = '<div class="black-trans">' + html + '</div>';
    x.style.top = (GetY(parent) + (parent.clientHeight - x.clientHeight) + 1).toString() + 'px';
    x.style.left = GetX(parent).toString() + 'px';
}

function HideCaption()
{
    b_over = false;
    setTimeout("ActualHide()", 50);
}

function ActualHide()
{
    if(b_over) return;
    var x = document.getElementById('frag-photo-caption-item');
    if(x != null)
    {
        x.parentNode.removeChild(x);
    }
}