﻿
function PhotoOver(evt, img, url, width, height, leftmargin, topmargin) {
    try {
        //document.title = img.id + "|" + url + "|" + width + "|" + height //DEBUG!!!
        var ct = document.getElementById("MasterPhoto")
        evt = GetEvent(evt)
        var l = parseInt(GetElementLeft(img))
        var t = parseInt(GetElementTop(img))
        var w = parseInt(img.width)
        var h = parseInt(img.height)
        if (width == null) width = w * 4
        if (height == null) height = h * 4
        var nw = parseInt(width) * 2
        var nh = parseInt(height) * 2
        if (nw > 300) {
            nh = nh * (300 / nw)
            nw = 300
        }
        if (nh > 300) {
            nw = nw * (300 / nh)
            nh = 300
        }
        ct.src = url
        ct.width = nw
        ct.height = nh
        if (leftmargin == null) leftmargin = 0
        ct.style.left = (l + w + leftmargin) + "px"
        ct.style.top = (t + (h * 0.5) - (nh * 0.5)) + "px"
        ct.style.display = ""
        //document.title = img.id + "|" + url + "|" + width + "|" + height + "|" + nw + "|" + nh + "|" + ct.style.left + "|" + ct.style.top //DEBUG!!!
    } catch (e) {
        alert(e.message || e)
    }
}
function PhotoOut() {
    try {
        var ct = document.getElementById("MasterPhoto")
        ct.src = "Images/Transparent.gif"
        ct.style.display = "none"
    } catch (e) {
        alert(e.message || e)
    }
}

//NIEUW

function PhotoOver2(evt, area, url, dx, dy) {
    var photo = document.getElementById("MasterPhoto")
    var l = parseInt(GetElementLeft(area))
    var w = parseInt(GetElementWidth(area))
    if (dx == null) dx = 50
    if (dy == null) dy = -50
    //document.title = w //DEBUG
    var t = parseInt(GetElementTop(area))
    photo.width = "250"
    photo.style.left = (l + w + dx) + "px"
    photo.style.top = (t + dy) + "px"
    photo.src = url
    photo.style.display = ""
}
function PhotoOut2(evt) {
    var photo = document.getElementById("MasterPhoto")
    photo.src = ""
    photo.style.display = "none"
}
