﻿var imgLargeURL = "";
function setImgSelection(imgLargeURLValue, imgSwapID, imgSwapURL, swapNow) {
    imgLargeURL = "";
    imgLargeURL = imgLargeURLValue; //Sets current Image selection url 
    if (swapNow && imgSwapID.length > 0 && imgSwapURL.length > 0) {
        MM_swapImage(imgSwapID, '', imgSwapURL, 0);
    }
}
function displayLargeImage(pageName, browserParam) {
    if (imgLargeURL.length > 0) {
        window.open(imgLargeURL, pageName, browserParam);
    }
}

function displayLargeImageAuto(imgPath) {
    var myImage = new Image();
    myImage.name = imgPath;
    myImage.src = imgPath;

}

function getImageDimensions() {
    var iWidth = this.width;
    var iHeight = this.height;
    if (iWidth > 0 && iHeight > 0) {
        this.document.parentWindow.resizeTo(iWidth, iHeight);
    }
    return true;
}

function displayLargeImageAuto(pageName) {
    if (imgLargeURL.length > 0) {
        var theWindow;
        var myImage = new Image();
        myImage.name = imgLargeURL;
        //myImage.onload = getImageDimensions;
        myImage.src = imgLargeURL;
        //browserParam = "status=0,width=0,height=0,toolbar=0";
        //theWindow = window.open(imgLargeURL, pageName, browserParam);
        theWindow = window.open(imgLargeURL, "_blank");
    }
}
/*
function displayLargeImageAuto(pageName) {
    if (imgLargeURL.length > 0) {
        browserParam = "status=0,width=0,height=0,toolbar=0";
        var theWindow = window.open(imgLargeURL, pageName, browserParam);
        if (theWindow.document.images.length > 0) {
            theWindow.resizeTo(theWindow.document.images[0].width + 5, theWindow.document.images[0].height + 5);
        }
    }
}
*/
