

function displayOverlayPict( pict, event) {

    var div = document.getElementById( "displayFormDiv");
    var img = document.getElementById( "displayFormPicture");
    img.setAttribute( "src", pict);
    if (event.target != undefined)
	target = event.target;
    else
	target = event.toElement;

    if (target.offsetParent.tagName == "TD") {
	target = target.offsetParent;
	y = target.offsetTop + 20 + target.offsetParent.offsetTop;
	x = target.offsetLeft + target.offsetParent.offsetLeft;
    }
    else {
	y = target.offsetTop + 20;
	x = target.offsetLeft;
    }

    //alert( x + " " + y + " " + width);


    // the width of the document
    b = document.getElementById( "cast-hesla");
    width = b.offsetWidth;
    //width = document.width;

    // this is the code itself
    div.setAttribute( "style", "background-color:white");

    div.style.position = "absolute";
    if (x > width - 100)
	div.style.right = "20px";
    else
	div.style.left = x+"px";

    div.style.top = y+"px";
    div.style.display = "block";

    //alert( target.offsetParent);
}


function removeOverlayPict( ) {
    var div = document.getElementById( "displayFormDiv");
    var img = document.getElementById( "displayFormPicture");
    div.style.display = "none"
}
