﻿/*
function PhotoOver(evt, img, url, width, height) {
    try {
        if (url == null) {
            var factor = 3
            var ct = document.getElementById("MasterPhoto")
            evt = GetEvent(evt)
            var l = GetElementLeft(img)
            var t = GetElementTop(img)
            var w = img.width
            var h = img.height
            ct.style.display = ""
            ct.src = img.src
            if (width != null && height != null) {
                var w = parseInt(width) * 2
                var h = parseInt(height) * 2
                var nw = w
                var nh = h
                if (nw > 200) {
                    nw = 200
                    nh = h * (nw / 200)
                }
                if (nh > 200) {
                    nw = w * (nh / 200)
                    nh = 200
                }
                ct.width = nw
                ct.height = nh
            } else {
                ct.width = parseInt(img.width) * factor
                ct.height = parseInt(img.height) * factor
            }
            ct.style.left = (l + w + 100) + "px"
            ct.style.top = (t - (parseInt(img.height) * factor * 0.5)) + "px"
        } else {
            var ct = document.getElementById("MasterPhoto2")
            evt = GetEvent(evt)
            var l = GetElementLeft(img)
            var t = GetElementTop(img)
            ct.style.display = ""
            ct.src = url
            if (width != null && height != null) {
                var w = parseInt(width) * 2
                var h = parseInt(height) * 2
                var nw = w
                var nh = h
                if (nw > 200) {
                    nw = 200
                    nh = h * (nw / 200)
                }
                if (nh > 200) {
                    nw = w * (nh / 200)
                    nh = 200
                }
                ct.width = nw
                ct.height = nh
            } else {
                ct.width = 150
            }
            ct.style.left = (l + 100) + "px"
            ct.style.top = (t - 100) + "px"
        }
    } catch (e) {
        alert(e.message || e)
    }
}
*/

function PhotoOver(evt, img, url, width, height) {
    try {
        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)
        ct.style.display = ""
        ct.src = url
        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.width = nw
        ct.height = nh
        ct.style.left = (l + w + 100) + "px"
        ct.style.top = (t + (h * 0.5) - (nh * 0.5)) + "px"
        //document.title = url + "|" + ct.style.left + "|" + ct.style.top + "|" + width + "|" + height + "|" + nw + "|" + nh + "|" + img.id //DEBUG!!!
    } catch (e) {
        alert(e.message || e)
    }
}
function PhotoOut() {
    try {
        var ct = document.getElementById("MasterPhoto")
        ct.style.display = "none"
        var ct = document.getElementById("MasterPhoto2")
        ct.style.display = "none"
    } catch (e) {
        alert(e.message || e)
    }
}

