﻿function displayLargeImage(addTo, largeImage, zoomImage, name, title, loadingZoomText) {
    if ($(addTo) == null) {
        alert("missingParent");
        return;
    }

    addTo.enabled = false;
    $('#' + addTo.id + ' > a').hide();
    if ($("#" + name).length == 0) {
        /// create the object
        var anchor = document.createElement("a");
        anchor.setAttribute("class", "jqzoom");
        anchor.setAttribute("id", name);
        anchor.setAttribute("name", name);
        anchor.setAttribute("title", title);
        anchor.setAttribute("href", zoomImage);
        anchor.style.border = "0";
        
        var img = document.createElement("img");
        img.setAttribute("src", largeImage);
        img.setAttribute("title", title);
        img.setAttribute("alt", title);
        anchor.appendChild(img);
        
        addTo.insertBefore(anchor, addTo.firstChild);
    }
    $('#' + name).fadeIn(500);
    $('#' + name).jqzoom({ zoomWidth: 365, zoomHeight: 220, lensReset: true,title:true, preloadText: loadingZoomText });
}
